test(tests/lean/extra): add test for saving recursive equation pre-terms
This commit is contained in:
parent
2403d555ee
commit
7d9d89bae6
4 changed files with 27 additions and 0 deletions
|
@ -34,6 +34,9 @@ add_test(lean_unknown_file2 bash ${LEAN_SOURCE_DIR}/cmake/check_failure.sh "${CM
|
|||
add_test(lean_server_trace ${CMAKE_CURRENT_BINARY_DIR}/lean --server-trace "${LEAN_SOURCE_DIR}/../tests/lean/interactive/consume_args.input")
|
||||
add_test(lean_server_trace ${CMAKE_CURRENT_BINARY_DIR}/lean --server-trace "${LEAN_SOURCE_DIR}/../tests/lean/interactive/options_cmd.trace")
|
||||
add_test(lean_server_trace ${CMAKE_CURRENT_BINARY_DIR}/lean --server-trace "${LEAN_SOURCE_DIR}/../tests/lean/interactive/commands.trace")
|
||||
add_test(NAME "lean_eqn_macro"
|
||||
WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lean/extra"
|
||||
COMMAND bash "./test_eqn_macro.sh" "${CMAKE_CURRENT_BINARY_DIR}/lean")
|
||||
|
||||
# LEAN TESTS
|
||||
file(GLOB LEANTESTS "${LEAN_SOURCE_DIR}/../tests/lean/*.lean")
|
||||
|
|
10
tests/lean/extra/eqn_macro1.lean
Normal file
10
tests/lean/extra/eqn_macro1.lean
Normal file
|
@ -0,0 +1,10 @@
|
|||
open nat
|
||||
|
||||
notation `foo` a :=
|
||||
match a with
|
||||
(c, d) := c + d
|
||||
end
|
||||
|
||||
eval foo (2, 3)
|
||||
|
||||
notation `bla` a `with` H := a ↓ H
|
4
tests/lean/extra/eqn_macro2.lean
Normal file
4
tests/lean/extra/eqn_macro2.lean
Normal file
|
@ -0,0 +1,4 @@
|
|||
import eqn_macro1
|
||||
open nat
|
||||
|
||||
eval foo (2, 3)
|
10
tests/lean/extra/test_eqn_macro.sh
Executable file
10
tests/lean/extra/test_eqn_macro.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: test_eq_macro.sh [lean-executable-path]"
|
||||
exit 1
|
||||
fi
|
||||
LEAN=$1
|
||||
export LEAN_PATH=../../../library:.
|
||||
$LEAN -o eqn_macro1.olean eqn_macro1.lean
|
||||
$LEAN eqn_macro2.lean
|
Loading…
Reference in a new issue