test(tests/lean/extra): add regression tests for issue #422

This commit is contained in:
Leonardo de Moura 2015-02-04 10:55:03 -08:00
parent 0cea63651d
commit 2a6ccb252e
8 changed files with 79 additions and 0 deletions

View file

@ -40,6 +40,9 @@ add_test(NAME "lean_eqn_macro"
add_test(NAME "lean_print_notation"
WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lean/extra"
COMMAND bash "./test_single.sh" "${CMAKE_CURRENT_BINARY_DIR}/lean" "print_tests.lean")
add_test(NAME "auto_completion_issue_422"
WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lean/extra"
COMMAND bash "./ac_bug.sh" "${CMAKE_CURRENT_BINARY_DIR}/lean")
# LEAN TESTS
file(GLOB LEANTESTS "${LEAN_SOURCE_DIR}/../tests/lean/*.lean")

19
tests/lean/extra/ac_bug.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
# Regression test for issue https://github.com/leanprover/lean/issues/422
set -e
if [ $# -ne 1 ]; then
echo "Usage: ac_bug.sh [lean-executable-path]"
exit 1
fi
LEAN=$1
export LEAN_PATH=../../../library:.
for f in `ls ac_bug*.input`; do
echo "testing $f..."
$LEAN --server-trace $f > $f.produced.out
if grep "nat.mul.assoc" $f.produced.out; then
echo "FAILED"
exit 1
fi
rm -f $f.produced.out
done
echo "done"

View file

@ -0,0 +1,9 @@
VISIT ac_bug.lean
SYNC 4
import data.nat
namespace nat
check mul.as
exit
WAIT
FINDP 3
mul.as

View file

@ -0,0 +1,9 @@
VISIT ac_bug.lean
SYNC 4
import data.nat
namespace nat
check mul.as
end nat
WAIT
FINDP 3
mul.as

View file

@ -0,0 +1,10 @@
VISIT ac_bug.lean
SYNC 5
import data.nat
namespace nat
check mul.as
end
nat
WAIT
FINDP 3
mul.as

View file

@ -0,0 +1,10 @@
VISIT ac_bug.lean
SYNC 5
import data.nat
namespace nat
check mul.as
def a := 10
end nat
WAIT
FINDP 3
mul.as

View file

@ -0,0 +1,9 @@
VISIT ac_bug.lean
SYNC 4
import data.nat
namespace nat
check mul.as
def a := 10
WAIT
FINDP 3
mul.as

View file

@ -0,0 +1,10 @@
VISIT ac_bug.lean
SYNC 5
import data.nat
namespace nat
check mul.as
def a := 10
exit
WAIT
FINDP 3
mul.as