aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorJosh Wainwright <josh.wainwright@ldra.com>2016-04-21 09:05:10 +0100
committerJosh Wainwright <josh.wainwright@ldra.com>2016-04-21 09:05:10 +0100
commit2b18735726cd92be87e20f30680d85e7f0f1a3b2 (patch)
tree7dfd6c5279ea9a3794d005941ac334d9a9b69099 /lua
parenta4f927716f69cc56d20b7960d345dc9d91cebbf5 (diff)
downloadvis-2b18735726cd92be87e20f30680d85e7f0f1a3b2.tar.gz
vis-2b18735726cd92be87e20f30680d85e7f0f1a3b2.tar.xz
Use .status files instead of .true files and write error to .err file
Diffstat (limited to 'lua')
-rw-r--r--lua/Makefile2
-rw-r--r--lua/basic_cursor.lua10
-rw-r--r--lua/basic_file.lua2
-rw-r--r--lua/getline.lua2
-rw-r--r--lua/test.sh9
5 files changed, 13 insertions, 12 deletions
diff --git a/lua/Makefile b/lua/Makefile
index 13619b9..7a45202 100644
--- a/lua/Makefile
+++ b/lua/Makefile
@@ -3,7 +3,7 @@
all: clean test
clean:
- rm -f *.out *.true
+ rm -f *.out *.status *.err
test:
@./test.sh
diff --git a/lua/basic_cursor.lua b/lua/basic_cursor.lua
index 5e45395..87adc0e 100644
--- a/lua/basic_cursor.lua
+++ b/lua/basic_cursor.lua
@@ -16,17 +16,17 @@ results[8] = win.cursor.col == 1
results[9] = win.cursor.pos == 0
-- Invalid location, negative (TODO these two seem flaky)
win.cursor:to(-20, -20)
-results[10] = win.cursor.line == 7 or 'true'
+results[10] = win.cursor.line == 1 or true
results[11] = win.cursor.col == 1
-results[12] = win.cursor.pos == 0 or 'true'
+results[12] = win.cursor.pos == 0 or true
-- Invalid location, after end of text, cursor ends up on last char
win.cursor:to(1000, 1000)
-results[13] = win.cursor.line == 7 or 'true'
+results[13] = win.cursor.line == 9 or true
results[14] = win.cursor.col == 1
-results[15] = win.cursor.pos == 63 or 'true'
+results[15] = win.cursor.pos == 63 or true
delete(win, '%')
for i, res in pairs(results) do
append(win, i-1, tostring(res))
end
-vis:command('w! basic_cursor.true')
+vis:command('w! basic_cursor.status')
diff --git a/lua/basic_file.lua b/lua/basic_file.lua
index bba3f78..bd8817f 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.true')
+vis:command('w! basic_file.status')
diff --git a/lua/getline.lua b/lua/getline.lua
index dfe1c82..7f9a018 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.true')
+vis:command('w getline.status')
diff --git a/lua/test.sh b/lua/test.sh
index f7c6fd4..852f035 100644
--- a/lua/test.sh
+++ b/lua/test.sh
@@ -26,15 +26,16 @@ for t in $test_files; do
TESTS_OK=$((TESTS_OK + 1))
else
printf "FAIL\n"
- diff -u $t.ref $t.out
+ diff -u $t.ref $t.out > $t.err
fi
- elif [ -e $t.true ]; then
- if ! grep -v true $t.true > /dev/null; then
+ 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"
- grep -vn true $t.true
+ printf "$t\n" > $t.err
+ grep -vn true $t.status >> $t.err
fi
else
printf "FAIL\n"