aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test_file_io.sh
blob: 07a335eea7e8bba26079f4d0d3f94f0ecb635d79 (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
cat <<'EOF' > input
foo
bar
baz
EOF
cat <<'EOF' > expected
foo
foo
bar
bar
baz
baz
EOF
test_diff hoge piyo fuga<<'EOF'
struct FILE;
typedef struct FILE FILE;
extern FILE* stdin;
extern FILE* stdout;
int fprintf();
char* fgets();
void* calloc();

int main() {
    char* buf = calloc(256, sizeof(char));
    while (fgets(buf, 256, stdin)) {
        fprintf(stdout, "%s%s", buf, buf);
    }
    return 0;
}
EOF