Download this file
| 1 | package bot |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | // TestScrubSelfNotes pins the output scrub: the "[note to self: …]" history |
| 6 | // annotation must never reach a posted reply, however the model weaves it in. |
| 7 | func TestScrubSelfNotes(t *testing.T) { |
| 8 | cases := []struct{ in, want string }{ |
| 9 | {"Tap to see your issues:\n[note to self: this reply attached 1 button(s) via tool calls]", |
| 10 | "Tap to see your issues:"}, |
| 11 | {"[note to self: this reply attached 2 button(s) via tool calls]", ""}, |
| 12 | {"Before [note to self: x] after", "Before after"}, |
| 13 | {"No notes here.", "No notes here."}, |
| 14 | {"A [bracket] that is not a note survives.", "A [bracket] that is not a note survives."}, |
| 15 | } |
| 16 | for _, c := range cases { |
| 17 | if got := scrubSelfNotes(c.in); got != c.want { |
| 18 | t.Errorf("scrubSelfNotes(%q) = %q, want %q", c.in, got, c.want) |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | |