26 lines
574 B
Go
26 lines
574 B
Go
package llm
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"runtime"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestModuleDoesNotReferenceInstructorGo(t *testing.T) {
|
|
_, file, _, ok := runtime.Caller(0)
|
|
if !ok {
|
|
t.Fatalf("runtime caller lookup failed")
|
|
}
|
|
repoRoot := filepath.Clean(filepath.Join(filepath.Dir(file), "..", "..", ".."))
|
|
|
|
modBytes, err := os.ReadFile(filepath.Join(repoRoot, "go.mod"))
|
|
if err != nil {
|
|
t.Fatalf("read go.mod: %v", err)
|
|
}
|
|
if strings.Contains(string(modBytes), "github.com/jxnl/instructor-go") {
|
|
t.Fatalf("unexpected instructor-go reference in go.mod")
|
|
}
|
|
}
|