package topdata import ( "os" "path/filepath" "testing" ) func TestHasLFSPointerStubsDetectsStub(t *testing.T) { root := t.TempDir() if err := os.MkdirAll(filepath.Join(root, "a"), 0o755); err != nil { t.Fatalf("mkdir: %v", err) } stub := "version https://git-lfs.github.com/spec/v1\noid sha256:abc\nsize 12345\n" writeFile(t, filepath.Join(root, "a", "model.mdl"), stub) writeFile(t, filepath.Join(root, "a", "real.txt"), "not a pointer, real bytes here") if !hasLFSPointerStubs(root) { t.Fatal("expected stub detection to be true") } } func TestHasLFSPointerStubsNoStub(t *testing.T) { root := t.TempDir() writeFile(t, filepath.Join(root, "real.mdl"), "binary-ish content without a pointer header") if hasLFSPointerStubs(root) { t.Fatal("expected no stub detected") } }