diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-11-29 17:35:35 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-11-29 17:35:35 +0100 |
commit | 43345546ae63710441f066648b8485fb545b3801 (patch) | |
tree | 6856441fbdb36ee40e5225b97b1e0e698fc72d62 /src/testdir/test_assert.vim | |
parent | 48a969b48898fb08dce636c6b918408c6fbd3ea0 (diff) |
patch 7.4.944v7.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.
Diffstat (limited to 'src/testdir/test_assert.vim')
-rw-r--r-- | src/testdir/test_assert.vim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim new file mode 100644 index 0000000000..61c77c5757 --- /dev/null +++ b/src/testdir/test_assert.vim @@ -0,0 +1,19 @@ +" Test that the methods used for testing work. + +func Test_assertFalse() + call assertFalse(0) +endfunc + +func Test_assertTrue() + call assertTrue(1) + call assertTrue(123) +endfunc + +func Test_assertEqual() + let s = 'foo' + call assertEqual('foo', s) + let n = 4 + call assertEqual(4, n) + let l = [1, 2, 3] + call assertEqual([1, 2, 3], l) +endfunc |