Complete shared domain contract verification
This commit is contained in:
@@ -88,7 +88,7 @@ func TestExtractReturnsCanonicalSpellListFromPrivateResponse(t *testing.T) {
|
||||
|
||||
func TestExtractPromptProjectsCanonicalNamesAndAliasesWithoutMetadata(t *testing.T) {
|
||||
client := &fakeSpellsLLMClient{response: extractionResponse{SpellCasts: []spellCastResponse{}}}
|
||||
extractor := newExtractor(t, client, overlaySpellCatalogReference())
|
||||
extractor := newExtractor(t, client, sharedGlossarySpellCatalogReference())
|
||||
if _, err := runExtraction(context.Background(), extractor, extractionRequest()); err != nil {
|
||||
t.Fatalf("Extract() error = %v, want nil", err)
|
||||
}
|
||||
@@ -127,7 +127,7 @@ func TestExtractUsesAliasRecognitionToRequestCanonicalSpellNames(t *testing.T) {
|
||||
request.Chunk.Content = []byte(`{"segments":[{"id":1,"text":"Aria invokes Emberfall Aegis."}]}`)
|
||||
request.SourceInput = spellChunkInput(request.Chunk)
|
||||
|
||||
result, err := runExtraction(context.Background(), newExtractor(t, client, overlaySpellCatalogReference()), request)
|
||||
result, err := runExtraction(context.Background(), newExtractor(t, client, sharedGlossarySpellCatalogReference()), request)
|
||||
if err != nil {
|
||||
t.Fatalf("Extract() error = %v, want nil", err)
|
||||
}
|
||||
@@ -162,7 +162,7 @@ func TestExtractAliasOnlyCatalogChangesPromptMaterial(t *testing.T) {
|
||||
|
||||
func TestNewRejectsMalformedCatalogBeforeLLMCall(t *testing.T) {
|
||||
client := &fakeSpellsLLMClient{}
|
||||
_, err := New(Options{}, spellCatalogReference(`{"schema_version":"notarius.dnd.spell-catalog-overlay.v2","catalogs":[]}`))
|
||||
_, err := New(Options{}, spellCatalogReference(`{"schema_version":"wrong","collections":{}}`))
|
||||
if err == nil || !strings.Contains(err.Error(), "resolve effective spell catalog") {
|
||||
t.Fatalf("New() error = %v, want effective catalog error", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user