aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/file_io.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/file_io.sh')
-rw-r--r--tests/file_io.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/file_io.sh b/tests/file_io.sh
new file mode 100644
index 0000000..07a335e
--- /dev/null
+++ b/tests/file_io.sh
@@ -0,0 +1,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
+