(t *testing.T, text string, substrings ...string)
| 440 | dir := t.TempDir() |
| 441 | store := session.NewStore(dir) |
| 442 | messages := []map[string]any{{"role": "user", "content": "<>&雪"}} |
| 443 | if err := store.Save("sess", messages, 1); err != nil { |
| 444 | t.Fatal(err) |
| 445 | } |
| 446 | data, err := os.ReadFile(filepath.Join(dir, "sess", "transcript.jsonl")) |
| 447 | if err != nil { |
| 448 | t.Fatal(err) |
| 449 | } |
| 450 | got := string(data) |
| 451 | if !strings.HasSuffix(got, "\n") { |
| 452 | t.Fatalf("JSONL should end each record with a newline, got %q", got) |
| 453 | } |
| 454 | if strings.Contains(got, `\u003c`) || strings.Contains(got, `\u003e`) || strings.Contains(got, `\u0026`) || !strings.Contains(got, "<>&雪") { |
| 455 | t.Fatalf("JSONL should match Python ensure_ascii=False text escaping, got %q", got) |
no outgoing calls
no test coverage detected