This commit is contained in:
@@ -5,7 +5,8 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLibraryCandidateValidatesPersistedTextIndexTransform(t *testing.T) {
|
||||
// Scheme A archives artifact bytes; these cases do not certify semantic quality.
|
||||
func TestLibraryCandidatePreservesArtifactContentWithoutReconstruction(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name, kind, body, index string
|
||||
valid bool
|
||||
@@ -13,11 +14,12 @@ func TestLibraryCandidateValidatesPersistedTextIndexTransform(t *testing.T) {
|
||||
{"current title prefix", "text", "\n chunk \t", "Document title\nchunk", true},
|
||||
{"legacy raw body", "text", "\n chunk \t", "\n chunk \t", true},
|
||||
{"trimmed body", "text", "\n chunk \t", "chunk", true},
|
||||
{"wrong title", "text", "chunk", "Other title\nchunk", false},
|
||||
{"missing body", "text", "chunk", "Document title\n", false},
|
||||
{"different body", "text", "chunk", "Document title\nchanged", false},
|
||||
{"unverifiable context header", "text", "chunk", "Document title\nTransient heading\n\nchunk", false},
|
||||
{"nontext transform not assumed", "faq", "chunk", "Document title\nchunk", false},
|
||||
{"wrong title", "text", "chunk", "Other title\nchunk", true},
|
||||
{"missing body", "text", "chunk", "Document title\n", true},
|
||||
{"different body", "text", "chunk", "Document title\nchanged", true},
|
||||
{"unverifiable context header", "text", "chunk", "Document title\nTransient heading\n\nchunk", true},
|
||||
{"nontext transform not assumed", "faq", "chunk", "Document title\nchunk", true},
|
||||
{"empty artifact content", "text", "chunk", " \n", false},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
pg, es, _ := libraryCandidateFixture()
|
||||
@@ -33,7 +35,7 @@ func TestLibraryCandidateValidatesPersistedTextIndexTransform(t *testing.T) {
|
||||
t.Fatalf("valid indexed text refused: %v", err)
|
||||
}
|
||||
if !tc.valid && err == nil {
|
||||
t.Fatal("unverifiable index content accepted")
|
||||
t.Fatal("empty index content accepted")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user