mirror of
https://github.com/walles/moar.git
synced 2024-09-11 12:15:43 +03:00
Add compressed file highlighting test case
For the initial part of <https://github.com/walles/moar/issues/204>.
This commit is contained in:
parent
056c766bd3
commit
02209f3d1d
@ -193,6 +193,32 @@ func TestCodeHighlighting(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCodeHighlight_compressed(t *testing.T) {
|
||||
// Same as TestCodeHighlighting but with "markdown.md.gz"
|
||||
reader, err := NewReaderFromFilename("../sample-files/markdown.md.gz", *styles.Get("native"), formatters.TTY16m, nil)
|
||||
assert.NilError(t, err)
|
||||
assert.NilError(t, reader._wait())
|
||||
|
||||
markdownHeading1Style := twin.StyleDefault.WithAttr(twin.AttrBold)
|
||||
var answers = []twin.Cell{
|
||||
twin.NewCell('#', markdownHeading1Style),
|
||||
twin.NewCell(' ', twin.StyleDefault),
|
||||
twin.NewCell('M', markdownHeading1Style),
|
||||
twin.NewCell('a', markdownHeading1Style),
|
||||
twin.NewCell('r', markdownHeading1Style),
|
||||
twin.NewCell('k', markdownHeading1Style),
|
||||
twin.NewCell('d', markdownHeading1Style),
|
||||
twin.NewCell('o', markdownHeading1Style),
|
||||
twin.NewCell('w', markdownHeading1Style),
|
||||
twin.NewCell('n', markdownHeading1Style),
|
||||
}
|
||||
|
||||
contents := startPaging(t, reader).GetRow(0)
|
||||
for pos, expected := range answers {
|
||||
assertCellsEqual(t, expected, contents[pos])
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnicodePrivateUse(t *testing.T) {
|
||||
// This character lives in a Private Use Area:
|
||||
// https://codepoints.net/U+f244
|
||||
|
BIN
sample-files/markdown.md.gz
Normal file
BIN
sample-files/markdown.md.gz
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user