Some checks failed
Documentation / build-and-publish (push) Waiting to run
Test / test (push) Waiting to run
Checkout test / test (push) Successful in 5s
CI with Native Libraries / test-native (push) Has been cancelled
CI with Native Libraries / build-release (push) Has been cancelled
34 lines
813 B
Go
34 lines
813 B
Go
package benchmarks
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/jfraeys/fetch_ml/internal/worker"
|
|
)
|
|
|
|
// TestNativeIntegration verifies native libraries are callable
|
|
func TestNativeIntegration(t *testing.T) {
|
|
// Check SIMD detection works
|
|
simdName := worker.GetSIMDImplName()
|
|
t.Logf("SIMD implementation: %s", simdName)
|
|
|
|
simdAvailable := worker.HasSIMDSHA256()
|
|
t.Logf("SIMD available: %v", simdAvailable)
|
|
|
|
// Create test directory
|
|
tmpDir := t.TempDir()
|
|
if err := os.WriteFile(tmpDir+"/test.txt", []byte("hello world"), 0644); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
// Test hashing works
|
|
hash, err := worker.DirOverallSHA256Hex(tmpDir)
|
|
if err != nil {
|
|
t.Fatalf("Hash failed: %v", err)
|
|
}
|
|
if len(hash) != 64 {
|
|
t.Fatalf("Expected 64 char hash, got %d: %s", len(hash), hash)
|
|
}
|
|
t.Logf("Hash result: %s", hash)
|
|
}
|