Skip Menu |

This queue is for tickets about the Text-VimColor CPAN distribution.

Report information
The Basics
Id: 75880
Status: resolved
Priority: 0/
Queue: Text-VimColor

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.15
Fixed in: 0.16



Subject: t/encoding.t fails in non-UTF-8 locale
I'd like inform you some tests in t/encoding.t fails if running in non-UTF-8 locale. I don't know where the problem is, vim probably recodes the text: $ LC_ALL=C prove --blib t/encoding.t t/encoding.t .. 1/? # Failed test 'used BOM to get vim to honor encoded text' # at t/encoding.t line 40. Wide character in print at /usr/share/perl5/Test/Builder.pm line 1759. # got: '<span class="synSpecial">(</span><span class="synComment"> ��rL + </span><span class="synTodo">vim</span><span class="synComment"> </span><span class="synSpecial">)</span> # ' # expected: '<span class="synSpecial">(</span><span class="synComment"> þêrL + </span><span class="synTodo">vim</span><span class="synComment"> </span><span class="synSpecial">)</span> # ' # Failed test 'specify encoding by adding "+set fenc=..." to vim_options' # at t/encoding.t line 43. # got: '<span class="synSpecial">(</span><span class="synComment"> þêrL + </span><span class="synTodo">vim</span><span class="synComment"> </span><span class="synSpecial">)</span> # ' # expected: '<span class="synSpecial">(</span><span class="synComment"> ��rL + </span><span class="synTodo">vim</span><span class="synComment"> </span><span class="synSpecial">)</span> # ' # Looks like you failed 2 tests of 3. t/encoding.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/3 subtests The test environment is: # # perl: v5.14.2 (wanted 5.006) on linux from /usr/bin/perl # # Carp => 1.20 (want any version) # Exporter => 5.64_03 (want any version) # ExtUtils::MakeMaker => 6.57_05 (want 6.30) # File::Copy => 2.21 (want any version) # File::Find => 1.19 (want any version) # File::ShareDir => 1.03 (want any version) # File::ShareDir::Install => 0.03 (want 0.03) # File::Temp => 0.22 (want any version) # Getopt::Long => 2.38 (want any version) # IO::File => 1.15 (want any version) # Path::Class => 0.25 (want any version) # Term::ANSIColor => 3.00 (want 3) # Test::More => 0.98 (want 0.88) # strict => 1.04 (want any version) # warnings => 1.12 (want any version) # # VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 21 2011 09:34:08) # Included patches: 1-315 # Modified by <bugzilla@redhat.com> # Compiled by <bugzilla@redhat.com> # Huge version without GUI. Features included (+) or not (-): # +arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent # -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments # +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs # -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path # +find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv # +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent # +listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape # +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse # +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg +path_extra +perl # +persistent_undo +postscript +printer +profile +python -python3 +quickfix # +reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime # +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white # -tcl +terminfo +termresponse +textobjects +title -toolbar +user_commands # +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore # +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp -xterm_clipboard # -xterm_save # system vimrc file: "/etc/vimrc" # user vimrc file: "$HOME/.vimrc" # user exrc file: "$HOME/.exrc" # fall-back for $VIM: "/etc" # f-b for $VIMRUNTIME: "/usr/share/vim/vim73" # Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/local/include -O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=1 # Linking: gcc -L. -Wl,-z,relro -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -Wl,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim -lm -lnsl -lselinux -lncurses -lacl -lattr -lgpm -ldl -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -fstack-protector -L/usr/lib64/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/lib64/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -lruby -lpthread -lrt -ldl -lcrypt -lm #
Very interesting output, since the "got" and "expected" seem to switch between the two tests (where the "expected" should always be the same). I want to improve the way this module handles encoding, and these tests were my initial effort into understanding how it works... I guess I have more to learn. Thank you very much for reporting. I may re-release with these tests marked as TODO's until I figure out how things should be working. I may have more questions for you if I can't figure out how to reproduce. Thanks again.
I actually copied the code for these tests from other modules that are using this one successfully because I wanted to make sure I didn't break anything for those modules. They must be ok in the environment in which they run (similar to my development environment I suppose).
It's easy to reproduce by just setting LC_ALL as you did in your example. Thanks again for reporting... now I just need to figure out what to do about it.
I modified the tests to run twice once with LANG=en_US.UTF-8 and once with LC_ALL=C The ENV vars appear to be affecting what vim returns... I'll have to look into it more to understand what should be happening. These are bugs in the tests, not the module, so I'll mark them as TODO tests until I figure out what it is I'm really trying to achieve with them. At least I've already learned something. :-) Thanks again for reporting!