Read the published research corpus and avoid expensive paging plans [skip ci]

This commit is contained in:
2026-11-07 15:51:17 +08:00
parent 913bf4292b
commit 1363792bb0
10 changed files with 355 additions and 37 deletions
+2 -1
View File
@@ -14,6 +14,7 @@ func TestStoredAuthorShapes(t *testing.T) {
want []string
}{
{`[]`, []string{}},
{`[["Buhrman","Harry","","CWI"],["Family","Given","Jr.","University"]]`, []string{"Harry Buhrman", "Given Family Jr."}},
{`["The BABAR Collaboration","B. Aubert"]`, []string{"The BABAR Collaboration", "B. Aubert"}},
{`[["Balázs","C.",""],["Berger","E. L.",""],["Smith","Ada","Jr."]]`, []string{"C. Balázs", "E. L. Berger", "Ada Smith Jr."}},
{`[" 张三 ",["Only family"],["","Only given",""],""]`, []string{"张三", "Only family", "Only given"}},
@@ -27,7 +28,7 @@ func TestStoredAuthorShapes(t *testing.T) {
t.Fatal("missing authors must remain an array")
}
}
for _, raw := range []string{`broken`, `{"unexpected":"object"}`, `[42]`, `[["a","b","c","d"]]`} {
for _, raw := range []string{`broken`, `{"unexpected":"object"}`, `[42]`, `[["a","b","c","d","e"]]`} {
if _, err := decodeAuthors(raw); err == nil {
t.Fatalf("accepted unsupported authors %s", raw)
}