1
1
mirror of https://github.com/walles/moar.git synced 2024-10-26 13:00:40 +03:00

Add subtests for readability

This commit is contained in:
Johan Walles 2023-11-10 22:50:23 +01:00
parent c7b4dbf2fd
commit 76ad92a34d

View File

@ -287,15 +287,17 @@ func TestHyperlink_incomplete(t *testing.T) {
complete := "a\x1b]8;;X\x1b\\"
for l := len(complete) - 1; l >= 0; l-- {
tokens := cellsFromString(complete[:l]).Cells
t.Run(fmt.Sprintf("l=%d", l), func(t *testing.T) {
tokens := cellsFromString(complete[:l]).Cells
for i := 0; i < l; i++ {
if complete[i] == '\x1b' {
// These get special rendering, if everything else matches
// that's good enough.
continue
for i := 0; i < l; i++ {
if complete[i] == '\x1b' {
// These get special rendering, if everything else matches
// that's good enough.
continue
}
assert.Equal(t, tokens[i], twin.Cell{Rune: rune(complete[i]), Style: twin.StyleDefault})
}
assert.Equal(t, tokens[i], twin.Cell{Rune: rune(complete[i]), Style: twin.StyleDefault})
}
})
}
}