Raimondi / delimitMate

Vim plugin, provides insert mode auto-completion for quotes, parens, brackets, etc.
http://www.vim.org/scripts/script.php?script_id=2754
1.98k stars 117 forks source link

Two failing tests in autoclose_quotes #182

Closed blueyed closed 9 years ago

blueyed commented 10 years ago

When I run the tests, I see two failures.

Is this expected?

% build/runVimTests/bin/runVimTests.sh .

Starting test run with these Vim options:
vim --cmd 'set rtp=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after' -N -u NORC -c 'set rtp&' -f -i '~/.vimtestinfo' -n -S '/home/daniel/.dotfiles/vim/bundle/delimitMate/test/build/runVimTests/bin/runVimTestsSetup.vim' --cmd "let g:runVimTests='default'"

autoclose_quotes:
not ok 29 - Line 8: «"x
# Test 'Line 8: «"x' failed:
# expected: '«"x"«'
# but got:  '«"x«'
not ok 114 - Line 29: abc\««<Space>x
# Test 'Line 29: abc\««<Space>x' failed:
# expected: 'abc\« x«'
# but got:  'abc\«« x'

4 files with 322 tests; 1 skipped, 321 run: 319 OK, 2 failures, 0 errors.
Tests with skips: autoclose_quotes.vim
   1 SKIP (tap): This test is invalid for double quote.
Failed tests: autoclose_quotes.vim
make: *** [test] Error 1
Raimondi commented 9 years ago

Do you still get this? I don't.

blueyed commented 9 years ago

Yes, I still get them.

Have you tried the "make test" recipe from #183?

Raimondi commented 9 years ago

I just merged #183 and I still have no problems. What version and patch level of Vim are you using?

blueyed commented 9 years ago

Vim 7.4.527.

Raimondi commented 9 years ago

Vim 7.4.526 here. Well, I've had problems with some multibyte characters on the Vim side of the equation before. Could you change that char in test/autoclose_quotes.vim for another multibyte character and try again? The test needs one multibyte char, it doesn't matter which character we use as long as it's multibyte.

blueyed commented 9 years ago

No success. The first test also fails when removing the "«":

autoclose_quotes:
not ok 21 - Line 8: ""x
# Test 'Line 8: ""x' failed:
# expected: '""x""'
# but got:  '""x'

I've tried setting HOME=/dev/null for the tests, but without a visible change, except for errors about writing the viminfo file.

Raimondi commented 9 years ago

I was able to reproduce this in a virtual machine with Mint, so I can play with this now. That failing test is supposed to fail, it's harcoded to be ignored in autoclose_quotes.vim. I can't remember now why, though.

Raimondi commented 9 years ago

The issue was that [:punct:] does not always match the same set of characters. I include the quotes in smart_quote's regex now and it seems it fixed this issue. Let me know if it doesn't in your end.

blueyed commented 9 years ago

:+1: Thanks for fixing it!