|
|
|
internal/event/room_reply_test.go raw
| 1 | package event | | 2 | | | 3 | import ( | | 4 | "strings" | | 5 | "testing" | | 6 | ) | | 7 | | | 8 | func TestRoomReplyRoot(t *testing.T) { | | 9 | a, b := strings.Repeat("a" , 64), strings.Repeat("b" , 64) | | 10 | for _, test := range []struct { | | 11 | name string | | 12 | kind int | | 13 | tags [][]string | | 14 | want string | | 15 | }{ | | 16 | {"root and parent" , 9, [][]string{{"e" , b, "" , "reply" , b}, {"e" , a, "" , "root" , a}}, a}, | | 17 | {"parent only" , 9, [][]string{{"e" , b, "" , "reply" }}, b}, | | 18 | {"mention is not reply" , 9, [][]string{{"e" , a, "" , "mention" }}, "" }, | | 19 | {"quote is not reply" , 9, [][]string{{"q" , a}}, "" }, | | 20 | {"legacy" , 12, [][]string{{"e" , a}}, a}, | | 21 | {"unmarked" , 9, [][]string{{"e" , a}, {"e" , b}}, a}, | | 22 | {"reaction" , 7, [][]string{{"e" , a}}, "" }, | | 23 | } { | | 24 | t.Run(test.name, func(t *testing.T) { | | 25 | if got := RoomReplyRoot(Event{Kind: test.kind, Tags: test.tags}); got != test.want { | | 26 | t.Fatalf("got %q want %q" , got, test.want) | | 27 | } | | 28 | }) | | 29 | } | | 30 | } |
|
|
About| owner | c01503e8035f |
|---|
| visibility | public |
|---|
| head | d730679639bf |
|---|
Maintainers- c01503e8035f owner
- ba1b5beed5b5 agent hermes
Clonehttps://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git
|