Commit Graph

293 Commits

Author SHA1 Message Date
Julian Mehne
42891ea9d9 Make migrated test33 more similar to old legacy test.
Remove `expandtab` and add a missing trailing space from the legacy test.
2014-12-06 13:43:14 +01:00
Eliseo Martínez
1f2c197ebe Fix functional-test-105 failure in OSX.
See https://github.com/neovim/neovim/issues/1519 for failure report.

Cause    : In OSX, /tmp is a symbolic link to /private/tmp, which causes
           expected and got results different because of implicit
           resolution.
Solution : Resolve path before setting expected value.
2014-11-21 22:08:16 +01:00
Thiago de Arruda
179c51319d test: Refactor functional helpers to use vim_input
The vim_input function accepts raw terminal input and so is better to emulate
real user, especially because it is not deferred as vim_feedkeys.

Using this function required a number of changes:

- expect() was refactored to use curbuf_contents()
- The vim_eval function in request() was moved to curbuf_contents(). For most
  cases this is enough(we only care for synchronizing api calls with user input
  when verifying buffer contents).
- <C-@>(NUL) is preprocessed before being passed to replace_termcodes.
- Legacy test 4 had a bug that only became visible when using vim_input, it is
  fixed now.
- An extra blank line deletion was required for test 101

The last two items show that vim_feedkeys because it is not 100% equivalent to
receiving terminal input.
2014-11-21 15:39:04 -03:00
Rainer Borene
df5a17fb51 legacy tests: migrate test105 2014-11-20 21:06:37 -03:00
Rainer Borene
da3ade6a59 legacy tests: migrate test26 2014-11-20 21:06:37 -03:00
Rainer Borene
021d9bdcc0 legacy tests: migrate test101 2014-11-20 21:06:37 -03:00
Rainer Borene
50876c2f70 legacy tests: migrate test75 2014-11-20 21:06:37 -03:00
Rainer Borene
a93d370c75 legacy tests: migrate test51 2014-11-20 21:06:37 -03:00
Rainer Borene
c9159586b8 legacy tests: migrate test43 2014-11-20 21:06:37 -03:00
Rainer Borene
bbd95c0514 legacy tests: migrate test33 2014-11-20 21:06:37 -03:00
Rainer Borene
8c872a945e legacy tests: migrate test67 2014-11-20 21:06:37 -03:00
Rainer Borene
7fc5d6fc8e legacy tests: migrate test66 2014-11-20 21:06:37 -03:00
Rainer Borene
963a146e8b legacy tests: migrate test25 2014-11-20 21:06:37 -03:00
Rainer Borene
8ca8a0da08 legacy tests: migrate test104 2014-11-20 21:06:37 -03:00
Rainer Borene
c152cdd0f3 legacy tests: migrate test5 2014-11-20 21:06:37 -03:00
Thiago de Arruda
168a46fd31 test: Improve test environment setup and error handling/reporting
During test setup, we used to call a vimscript function(BeforeEachTest) that
attempted to restore Nvim to it's initial state as much as possible in order to
provide a clean environment for running new tests. This approach has proven to
be unreliable, as some tests leave state that can affect other tests, eventually
causing failures that are difficult to debug.

This commit changes the 'clear' function so it will restart Nvim every time it
is called, which is a slower, but more reliable solution that will simplify
spotting bugs in the future.

Some other improvements/fixes were also performed:

- Whenever an error is detected in a handler passed to "run()", the event loop
  will be stopped and the error will be propagated to the main thread.
- Errors and the "cleanup()" function will always send a quit command to the
  current Nvim instance. This should prevent memory starvation when running
  tests under valgrind(where each Nvim instance can consume a lot of memory).
- Fixed a wrong assertion in server_requests_spec.lua. Previously the failure
  was undetected in a notification handler.
- Fixed some tests to expect fully clean registers. The deleted cleanup function
  used to put an empty string in every register, but that resulted in a extra
  line being added.
2014-11-07 00:55:58 -03:00
Thiago de Arruda
117d3db6d7 test: Simplify/fix options_spec.lua
The options_spec.lua suite has one purpose: Check if the :options commands will
throw any exception(:options is implemented by $VIMRUNTIME/optwin.vim). For this
it is best to use the `vim_command` API function since it will automatically
catch exceptions and forward them via msgpack-rpc.

Also, the option window seems to affect other tests, so call `restart` in the
teardown hook.
2014-11-06 04:21:57 -03:00
Rainer Borene
a695c87863 legacy tests: migrate test21 2014-11-04 12:57:33 -03:00
Rainer Borene
2d8d4285e4 legacy tests: migrate test7 2014-11-04 12:57:33 -03:00
Rainer Borene
ef08a2c0df legacy tests: migrate test6 2014-11-04 12:57:33 -03:00
Rainer Borene
38bef424a2 legacy tests: migrate test28 2014-11-04 12:57:33 -03:00
Rainer Borene
ca0a55c2a9 legacy tests: migrate test20 2014-11-04 12:57:33 -03:00
Rainer Borene
afe9aa758e legacy tests: migrate test97 2014-11-04 12:57:33 -03:00
Rainer Borene
5ea94e14f0 legacy tests: migrate test46 2014-11-04 12:57:33 -03:00
Rainer Borene
ac52d84f16 legacy tests: migrate test27 2014-11-04 12:57:33 -03:00
Rainer Borene
34cc2b1e33 legacy tests: migrate test54 2014-11-04 12:57:33 -03:00
Rainer Borene
fd503f1432 legacy tests: migrate test41 2014-11-04 12:57:33 -03:00
Rainer Borene
f85051b67e legacy tests: migrate test23 2014-11-04 12:57:33 -03:00
Rainer Borene
ffd5c43e84 legacy tests: migrate test56 2014-11-04 12:57:33 -03:00
Rainer Borene
4873171fc6 legacy tests: migrate test_autoformat_join 2014-11-04 12:57:33 -03:00
Rainer Borene
b67ad4f67f legacy tests: migrate test_changelist 2014-11-04 12:57:33 -03:00
Rainer Borene
4ca353d3bd legacy tests: migrate test81 2014-11-04 12:57:33 -03:00
Rainer Borene
79cd4a98ec legacy tests: migrate test_utf8 2014-11-04 12:57:33 -03:00
Rainer Borene
683b75d052 legacy tests: migrate test_insertcount 2014-11-04 12:57:33 -03:00
Rainer Borene
5b7d9bbd08 legacy tests: migrate test_options 2014-11-04 12:57:32 -03:00
Rainer Borene
b33c92439b legacy tests: migrate test18 2014-11-04 12:57:32 -03:00
Rainer Borene
481c449c72 legacy tests: migrate test106 2014-11-04 12:57:32 -03:00
Rainer Borene
6c90902c7a legacy tests: migrate test22 2014-11-04 12:57:32 -03:00
Rainer Borene
b780e946d5 legacy tests: migrate test9 2014-11-04 12:57:32 -03:00
Rainer Borene
d4f92e521c legacy tests: migrate test102 2014-11-04 12:57:32 -03:00
Rainer Borene
dbc7a8d987 legacy tests: migrate test4 2014-11-04 12:57:32 -03:00
Nate Sullivan
d11fd1950f legacy tests: migrate test35. #1318
Migrate vim's integration test 35 (increment/decrement commands) to
lua/busted.
2014-10-22 15:28:26 -04:00
Thiago de Arruda
549fc9548d test: Move 'test/legacy' to 'test/functional'
Busted can only discover tests from a single directory. In order to allow tests
under 'legacy' to run as a functional test, it needed to be moved to
'test/functional'.
2014-10-01 09:05:28 -03:00