walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
600 stars 17 forks source link

Compile Tests Failing on Arch Linux #29

Closed ImNtReal closed 3 years ago

ImNtReal commented 3 years ago

I'm currently unable to pass tests for 0.9.23, or HEAD on Arch Linux.

$ git clone git@github.com:walles/moar.git
Cloning into 'moar'...
remote: Enumerating objects: 83, done.
remote: Counting objects: 100% (83/83), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 1999 (delta 45), reused 57 (delta 28), pack-reused 1916
Receiving objects: 100% (1999/1999), 3.92 MiB | 7.75 MiB/s, done.
Resolving deltas: 100% (1138/1138), done.

$ cd moar && ./test.sh
--- FAIL: TestGetLongLine (0.09s)
    reader_test.go:161: assertion failed: expression is false: strings.HasPrefix(line, "1 2 3 4")
FAIL
FAIL    github.com/walles/moar/m        13.138s
FAIL

$ highlight --version

 highlight version 3.59
 Copyright (C) 2002-2020 Andre Simon <a dot simon at mailbox.org>

 Argparser class
 Copyright (C) 2006-2008 Antonio Diaz Diaz <ant_diaz at teleline.es>

 Artistic Style Classes (3.1 rev. 672)
 Copyright (C) 2006-2018 by Jim Pattee <jimp03 at email.com>
 Copyright (C) 1998-2002 by Tal Davidson

 Diluculum Lua wrapper (1.0)
 Copyright (C) 2005-2013 by Leandro Motta Barros

 xterm 256 color matching functions
 Copyright (C) 2006 Wolfgang Frisch <wf at frexx.de>

 This software is released under the terms of the GNU General Public License.
 For more information about these matters, see the file named COPYING.
highlight --out-format=esc -i m/pager_test.go

Seems to work correctly.

walles commented 3 years ago

Worked for me with highlight 3.58, fails with highlight 3.59.

I just pushed a change for printing the line contents when this case fails, so if you pulling the latest code from master you might get some hints on what's going wrong.

walles commented 3 years ago

Seems like the latest version of Highlight adds some invisible data at the start of the string:

~/s/moar (master|✚1) $ highlight --out-format=esc -i sample-files/very-long-line.txt|hexdump -C|head
00000000  1b 5b 30 30 3b 30 30 6d  31 20 32 20 33 20 34 20  |.[00;00m1 2 3 4 |
00000010  35 20 36 20 37 20 38 20  39 20 31 30 20 30 31 32  |5 6 7 8 9 10 012|
00000020  33 34 35 36 37 38 39 30  31 32 33 34 35 36 37 38  |3456789012345678|
00000030  39 30 31 32 33 34 35 36  37 38 39 30 31 32 33 34  |9012345678901234|
00000040  35 36 37 38 39 30 31 32  33 34 35 36 37 38 39 30  |5678901234567890|
00000050  31 32 33 34 35 36 37 38  39 30 31 32 33 34 35 36  |1234567890123456|
00000060  37 38 39 30 31 32 33 34  35 36 37 38 39 30 31 32  |7890123456789012|
00000070  33 34 35 36 37 38 39 30  31 32 33 34 35 36 37 38  |3456789012345678|
00000080  39 30 31 32 33 34 35 36  37 38 39 30 31 32 33 34  |9012345678901234|
00000090  35 36 37 38 39 30 31 32  33 34 35 36 37 38 39 30  |5678901234567890|
~/s/moar (master|✚1) $
walles commented 3 years ago

This was only a problem with running the tests, won't release a new version for this.

Unless this is blocking you somehow @ImNtReal?

And thanks for reporting!

walles commented 3 years ago

Changed my mind, this fix is now released: https://github.com/walles/moar/releases/tag/1.0