
import io;
import files;
import sys;
import assert;

main
{
  // Test with mapped file
  file f <"test.tmp">;
  f = write("hello world!");
  string s;
  s = read(f);
  printf("%s", s);
  assertEqual(s, "hello world!", "mapped");
  
  // Test with unmapped file
  file f2 = write("testing!");
  string s2 = read(f2);
  printf("%s", s2);
  assertEqual(s2, "testing!", "unmapped");
}



import io;
import files;
import sys;


main
{
  file f <"test.tmp">;
  f = write("hello world!");
  string s;
  s = read(f);
  printf("%s", s);
}


--- 
+++ 
@@ -2,14 +2,22 @@
 import io;
 import files;
 import sys;
-
+import assert;
 
 main
 {
+  // Test with mapped file
   file f <"test.tmp">;
   f = write("hello world!");
   string s;
   s = read(f);
   printf("%s", s);
+  assertEqual(s, "hello world!", "mapped");
+  
+  // Test with unmapped file
+  file f2 = write("testing!");
+  string s2 = read(f2);
+  printf("%s", s2);
+  assertEqual(s2, "testing!", "unmapped");
 }
 
Improve test to exercise logic with unmapped files

git-svn-id: 47705994653588c662f4ea400dfe88107361c0e2@8634 dc4e9af1-7f46-4ead-bba6-71afc04862de
