aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/096.sh
blob: 8bd6848c70a7d99ff72e67abc61d276c300fe9b0 (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
34
35
36
37
38
39
40
41
set -e

cat <<'EOF' > expected
10 20
100 300 500
EOF

bash ../../test_diff.sh <<'EOF'
int printf();
in\
t ma\
in() {
    int x = 1\
0;

    int y = 2\
\
\
0;

#def\
ine X 100
#define Y 100 + \
200
#define Z /*
*/ 500
    // comment \
    x *= 100, y *= 200;
    /* comment *\
/

    printf("%d %d\n", x, y);
    printf("%d %d %d\n", X, Y, Z);
}
EOF

cat <<'EOF' > expected
main.c:1: <new-line> expected, but got <eof>
EOF

echo -n 'int main() {}\' | bash ../../test_compile_error.sh