aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/056.sh
blob: 7bad4c01832743ff3b8aa9765c7d9a7d813356f5 (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
set -e

cat <<'EOF' > expected
12
EOF

cat <<'EOF' > math.h
int multiply(int a, int b) {
    return a * b;
}
EOF

cat <<'EOF' > calc.h
#include "math.h"

int calculate(int x) {
    return multiply(x, 2);
}

int printf(const char*, ...);
EOF

bash ../../test_diff.sh <<'EOF'
#include "calc.h"

int main() {
    printf("%d\n", calculate(6));
    return 0;
}
EOF