Federated via graft
517 B
15 lines
1package state
2
3import "testing"
4
5func TestMirrorMarkerNotSpoofableByVisibleText(t *testing.T) {
6 real := "**via Forgejo:** I'm just quoting the mirror format, not a real mirrored comment"
7 if IsMirroredComment(real) {
8 t.Fatal("a genuine comment that merely starts with the old visible prefix must not be treated as mirrored")
9 }
10
11 marked := MarkMirrored("**via Forgejo:**\n\nsome mirrored body")
12 if !IsMirroredComment(marked) {
13 t.Fatal("a body carrying the invisible marker must be recognized as mirrored")
14 }
15}