diff options
| author | watiko <service@mail.watiko.net> | 2015-12-13 12:19:54 +0900 |
|---|---|---|
| committer | watiko <service@mail.watiko.net> | 2016-01-10 09:01:30 +0900 |
| commit | 593df501b3a3687abb14a84299716bcd328b6ff8 (patch) | |
| tree | 5b9b9a381ea8f25d60e35a3be65f483703a33a7b /src/nvim/testdir/test_assert.vim | |
| parent | 50db0312f941ba489466d7d6b21088f1870429ee (diff) | |
| download | rneovim-593df501b3a3687abb14a84299716bcd328b6ff8.tar.gz rneovim-593df501b3a3687abb14a84299716bcd328b6ff8.tar.bz2 rneovim-593df501b3a3687abb14a84299716bcd328b6ff8.zip | |
vim-patch:7.4.944
Problem: Writing tests for Vim script is hard.
Solution: Add assertEqual(), assertFalse() and assertTrue() functions. Add
the v:errors variable. Add the runtest script. Add a first new
style test script.
https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Diffstat (limited to 'src/nvim/testdir/test_assert.vim')
| -rw-r--r-- | src/nvim/testdir/test_assert.vim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_assert.vim b/src/nvim/testdir/test_assert.vim new file mode 100644 index 0000000000..049ce98859 --- /dev/null +++ b/src/nvim/testdir/test_assert.vim @@ -0,0 +1,19 @@ +" Test that the methods used for testing work. + +func Test_assert_false() + call assert_false(0) +endfunc + +func Test_assert_true() + call assert_true(1) + call assert_true(123) +endfunc + +func Test_assert_equal() + let s = 'foo' + call assert_equal('foo', s) + let n = 4 + call assert_equal(4, n) + let l = [1, 2, 3] + call assert_equal([1, 2, 3], l) +endfunc |