Mercurial > vim
comparison src/testdir/test_assert.vim @ 7279:b5e9810b389d v7.4.945
commit https://github.com/vim/vim/commit/683fa185a4b4ed7595e5942901548b8239ed5cdb
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Nov 30 21:38:24 2015 +0100
patch 7.4.945
Problem: New style testing is incomplete.
Solution: Add the runtest script to the list of distributed files.
Add the new functions to the function overview.
Rename the functions to match Vim function style.
Move undolevels testing into a new style test script.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 30 Nov 2015 21:45:04 +0100 |
parents | 6600871bb38c |
children | bc5de65e499a |
comparison
equal
deleted
inserted
replaced
7278:cbb385c32701 | 7279:b5e9810b389d |
---|---|
1 " Test that the methods used for testing work. | 1 " Test that the methods used for testing work. |
2 | 2 |
3 func Test_assertFalse() | 3 func Test_assert_false() |
4 call assertFalse(0) | 4 call assert_false(0) |
5 endfunc | 5 endfunc |
6 | 6 |
7 func Test_assertTrue() | 7 func Test_assert_true() |
8 call assertTrue(1) | 8 call assert_true(1) |
9 call assertTrue(123) | 9 call assert_true(123) |
10 endfunc | 10 endfunc |
11 | 11 |
12 func Test_assertEqual() | 12 func Test_assert_equal() |
13 let s = 'foo' | 13 let s = 'foo' |
14 call assertEqual('foo', s) | 14 call assert_equal('foo', s) |
15 let n = 4 | 15 let n = 4 |
16 call assertEqual(4, n) | 16 call assert_equal(4, n) |
17 let l = [1, 2, 3] | 17 let l = [1, 2, 3] |
18 call assertEqual([1, 2, 3], l) | 18 call assert_equal([1, 2, 3], l) |
19 endfunc | 19 endfunc |