test for renameFile
authorSimon Marlow <marlowsd@gmail.com>
Mon, 18 Aug 2008 15:50:59 +0000 (15:50 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Mon, 18 Aug 2008 15:50:59 +0000 (15:50 +0000)
tests/all.T
tests/renameFile001.hs [new file with mode: 0644]
tests/renameFile001.stdout [new file with mode: 0644]

index 633a8d8..8fd3847 100644 (file)
@@ -10,3 +10,7 @@ test('getPermissions001', omit_ways(['ghci']), compile_and_run, ['-cpp'])
 
 test('copyFile001',  normal, compile_and_run, [''])
 test('copyFile002',  normal, compile_and_run, [''])
+
+test('renameFile001', extra_clean(['renameFile001.tmp1','renameFile001.tmp2']),
+      compile_and_run, [''])
+
diff --git a/tests/renameFile001.hs b/tests/renameFile001.hs
new file mode 100644 (file)
index 0000000..2bbdb8c
--- /dev/null
@@ -0,0 +1,13 @@
+import System.Directory\r
+\r
+tmp1 = "renameFile001.tmp1"\r
+tmp2 = "renameFile001.tmp2"\r
+\r
+main = do\r
+  writeFile tmp1 "test"\r
+  renameFile tmp1 tmp2\r
+  readFile tmp2 >>= print\r
+  writeFile tmp1 "test2"\r
+  renameFile tmp2 tmp1  \r
+  readFile tmp1 >>= print\r
+  \r
diff --git a/tests/renameFile001.stdout b/tests/renameFile001.stdout
new file mode 100644 (file)
index 0000000..6449f83
--- /dev/null
@@ -0,0 +1,2 @@
+"test"
+"test"