-
Notifications
You must be signed in to change notification settings - Fork 6
/
test.sh
executable file
·52 lines (41 loc) · 1.86 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
lake build
check_command() {
local cmd="$1"
local expected="$2"
output=$($cmd 2>&1)
if [ $? -eq 0 ]; then
echo "Error: The command '$cmd' succeeded but was expected to fail."
exit 1
fi
if [[ "$output" != "$expected" ]]; then
echo "Error: The command '$cmd' did not produce the expected error."
echo "Expected:"
echo "$expected"
echo "Got:"
echo "$output"
exit 1
fi
}
check_command "lake -q exe lean4checker Lean4CheckerTests.AddFalse" "lean4checker found a problem in Lean4CheckerTests.AddFalse
uncaught exception: (kernel) declaration type mismatch, 'false' has type
Prop
but it is expected to have type
False"
check_command "lake -q exe lean4checker Lean4CheckerTests.AddFalseConstructor" "lean4checker found a problem in Lean4CheckerTests.AddFalseConstructor
uncaught exception: No such constructor False.intro"
check_command "lake -q exe lean4checker Lean4CheckerTests.ReplaceAxiom" "lean4checker found a problem in Lean4CheckerTests.ReplaceAxiom
uncaught exception: application type mismatch
False.elim @propext
argument has type
∀ {a b : Prop}, (a ↔ b) → a = b
but function has type
False → ∀ (x y z n : Nat), 0 < x → 0 < y → 0 < z → 2 < n → x ^ n + y ^ n ≠ z ^ n"
check_command "lake -q exe lean4checker --fresh Lean4CheckerTests.UseFalseConstructor" "uncaught exception: (kernel) unknown constant 'False.intro'"
# The 'ReduceBool' test writes to a temporary file.
# We clean up before and afterwards for consistency, although neither should be required.
rm -f .lean4checker.tmp
check_command "lake -q exe lean4checker Lean4CheckerTests.ReduceBool" "lean4checker found a problem in Lean4CheckerTests.ReduceBool
uncaught exception: (kernel) unknown declaration 'foo'"
rm -f .lean4checker.tmp
echo "All commands produced the expected errors."