diff options
| author | Josh Wainwright <josh.wainwright@ldra.com> | 2016-04-25 15:31:12 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-04-26 09:29:35 +0200 |
| commit | 164794e60fd382584cdd64808ce837b885f385c1 (patch) | |
| tree | 625c0f2e5f2a4472461cb45f9b4bbe21c02ffccf /lua | |
| parent | 13499cc0d53277f7604eec2009476c1655cd8ba9 (diff) | |
| download | vis-164794e60fd382584cdd64808ce837b885f385c1.tar.gz vis-164794e60fd382584cdd64808ce837b885f385c1.tar.xz | |
Remove .status files, just use .ref and .out pairs
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/Makefile | 2 | ||||
| -rw-r--r-- | lua/README.md | 18 | ||||
| -rw-r--r-- | lua/basic_cursor.lua | 2 | ||||
| -rw-r--r-- | lua/basic_cursor.ref | 15 | ||||
| -rw-r--r-- | lua/basic_empty_file.lua | 2 | ||||
| -rw-r--r-- | lua/basic_empty_file.ref | 6 | ||||
| -rw-r--r-- | lua/basic_file.lua | 2 | ||||
| -rw-r--r-- | lua/basic_file.ref | 10 | ||||
| -rw-r--r-- | lua/getline.lua | 2 | ||||
| -rw-r--r-- | lua/getline.ref | 5 | ||||
| -rw-r--r-- | lua/test.sh | 9 |
11 files changed, 46 insertions, 27 deletions
diff --git a/lua/Makefile b/lua/Makefile index 7a45202..c74ed9e 100644 --- a/lua/Makefile +++ b/lua/Makefile @@ -3,7 +3,7 @@ all: clean test clean: - rm -f *.out *.status *.err + rm -f *.out *.err test: @./test.sh diff --git a/lua/README.md b/lua/README.md index 9b19a83..4f8a6fb 100644 --- a/lua/README.md +++ b/lua/README.md @@ -1,21 +1,13 @@ Tests for vis specific lua api ------------------------------ -There are two types of lua tests here: - -1. Tests are formed from a `<test>.in`, `<test>.ref` and `<test>.out` triplet. - The `<test>.in` file is opened by vis, some operatations are performed and - the modified file is written to `<test>.out`. The new `<test>.out` is - compared to `<test>.ref` and the test passes if they are identical. - -2. Tests are formed from a single `<test>.status` file. This file is created by - the lua code in the test. It contains a single line per test case, this - single line should be `true` if the test case passed. The `<test>.status` - file is checked to ensure it contains only `true` lines and if so, the test - passes. +Tests are formed from a `<test>.in`, `<test>.ref` and `<test>.out` triplet. +The `<test>.in` file is opened by vis, some operatations are performed and the +modified file is written to `<test>.out`. The new `<test>.out` is compared to +`<test>.ref` and the test passes if they are identical. The shell script `test.sh` looks for a file with extension `.in`, eg `test.in`, and opens it in vis. The corresponding lua file, `test.lua`, is executed and is -expected to create either a `test.out` or `test.status` file. +expected to create a `test.out` file. Type `make` to run all tests. diff --git a/lua/basic_cursor.lua b/lua/basic_cursor.lua index 87adc0e..842914c 100644 --- a/lua/basic_cursor.lua +++ b/lua/basic_cursor.lua @@ -29,4 +29,4 @@ delete(win, '%') for i, res in pairs(results) do append(win, i-1, tostring(res)) end -vis:command('w! basic_cursor.status') +vis:command('w! basic_cursor.out') diff --git a/lua/basic_cursor.ref b/lua/basic_cursor.ref new file mode 100644 index 0000000..1af6f7e --- /dev/null +++ b/lua/basic_cursor.ref @@ -0,0 +1,15 @@ +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true diff --git a/lua/basic_empty_file.lua b/lua/basic_empty_file.lua index de1c14e..9cd8cd0 100644 --- a/lua/basic_empty_file.lua +++ b/lua/basic_empty_file.lua @@ -12,4 +12,4 @@ delete(win, '%') for i = 1, #results do append(win, i-1, tostring(results[i])) end -vis:command('w! basic_empty_file.status') +vis:command('w! basic_empty_file.out') diff --git a/lua/basic_empty_file.ref b/lua/basic_empty_file.ref new file mode 100644 index 0000000..5ec39bb --- /dev/null +++ b/lua/basic_empty_file.ref @@ -0,0 +1,6 @@ +true +true +true +true +true +true diff --git a/lua/basic_file.lua b/lua/basic_file.lua index bd8817f..dcce41b 100644 --- a/lua/basic_file.lua +++ b/lua/basic_file.lua @@ -12,4 +12,4 @@ delete(win, '%') for i = 1, #results do append(win, i-1, tostring(results[i])) end -vis:command('w! basic_file.status') +vis:command('w! basic_file.out') diff --git a/lua/basic_file.ref b/lua/basic_file.ref new file mode 100644 index 0000000..b0effa2 --- /dev/null +++ b/lua/basic_file.ref @@ -0,0 +1,10 @@ +true +true +true +true +true +true +true +true +true +true diff --git a/lua/getline.lua b/lua/getline.lua index 7f9a018..c8b0fe2 100644 --- a/lua/getline.lua +++ b/lua/getline.lua @@ -14,4 +14,4 @@ delete(win, '%') for i = 1, #results do append(win, i-1, tostring(results[i])) end -vis:command('w getline.status') +vis:command('w getline.out') diff --git a/lua/getline.ref b/lua/getline.ref new file mode 100644 index 0000000..36c7afa --- /dev/null +++ b/lua/getline.ref @@ -0,0 +1,5 @@ +true +true +true +true +true diff --git a/lua/test.sh b/lua/test.sh index cedad08..1455f3d 100644 --- a/lua/test.sh +++ b/lua/test.sh @@ -30,15 +30,6 @@ for t in $test_files; do printf "FAIL\n" diff -u "$t".ref "$t".out > "$t".err fi - elif [ -e "$t".status ]; then - if ! grep -v true "$t".status > /dev/null; then - printf "PASS\n" - TESTS_OK=$((TESTS_OK + 1)) - else - printf "FAIL\n" - printf "%s\n" "$t" > "$t".err - grep -vn true "$t".status >> "$t".err - fi else printf "FAIL\n" fi |
