package app import "testing" func TestCitationMarkersPointAtSources(t *testing.T) { for in, want := range map[string]string{ "ARC is separate [2:section-9][1:section-46].": "ARC is separate [2][1].", "see [source-1:section-2] and [1:section-3][1:section-4]": "see [1] and [1]", "kept [1][2], code a[0] and [link](https://x.org)": "kept [1][2], code a[0] and [link](https://x.org)", "repeat [3][3][1][3]": "repeat [3][1]", } { if got := citationMarkers(in); got != want { t.Errorf("%q: got %q want %q", in, got, want) } } }