okami.mom/web-extract-go

git clone https://git.nkp.pet/okami.mom/web-extract-go

nekomimi.petanswers: cite sources as [n], not the passage IDs the model copies9352270

main
597 B16 linesraw
1package app
2
3import "testing"
4
5func TestCitationMarkersPointAtSources(t *testing.T) {
6	for in, want := range map[string]string{
7		"ARC is separate [2:section-9][1:section-46].":            "ARC is separate [2][1].",
8		"see [source-1:section-2] and [1:section-3][1:section-4]": "see [1] and [1]",
9		"kept [1][2], code a[0] and [link](https://x.org)":        "kept [1][2], code a[0] and [link](https://x.org)",
10		"repeat [3][3][1][3]":                                     "repeat [3][1]",
11	} {
12		if got := citationMarkers(in); got != want {
13			t.Errorf("%q: got %q want %q", in, got, want)
14		}
15	}
16}