aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test_compile_errors.sh
blob: 23bf394f0ead03651dbeee2daef3c8a86c0ce5ed (plain)
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
cat <<'EOF' > expected
undefined function: f
EOF
test_compile_error <<'EOF'
int main() {
    f();
}
EOF

# TODO: improve error message
# cat <<'EOF' > expected
# main.c:1: expected ';' or '{', but got '}'
# EOF
cat <<'EOF' > expected
main.c:1: expected ';', but got '}'
EOF

test_compile_error <<'EOF'
int main() }
EOF

# TODO: improve error message
# cat <<'EOF' > expected
# main.c:1: expected ';' or '{', but got '}'
# EOF
cat <<'EOF' > expected
main.c:1: expected ';', but got '123'
EOF

test_compile_error <<'EOF'
int main() 123
EOF