Browse Source

+ Test for append on devices.

git-svn-id: trunk@6787 -
daniel 18 years ago
parent
commit
5784674f20
2 changed files with 24 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 23 0
      tests/tbs/tb0532.pp

+ 1 - 0
.gitattributes

@@ -6263,6 +6263,7 @@ tests/tbs/tb0527.pp svneol=native#text/plain
 tests/tbs/tb0528.pp svneol=native#text/x-pascal
 tests/tbs/tb0530.pp svneol=native#text/plain
 tests/tbs/tb0531.pp svneol=native#text/plain
+tests/tbs/tb0532.pp svneol=native#text/x-pascal
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain
 tests/tbs/ub0119.pp svneol=native#text/plain

+ 23 - 0
tests/tbs/tb0532.pp

@@ -0,0 +1,23 @@
+program tb0532;
+
+{Append was the recommended way to open devices in TP.
+ A pitfall is that you cannot seek to the end of a device.
+
+ It has to work on modern platforms too, because:
+  - Rewrite will destroy the device on platforms where devices are
+    files.
+  - Reset doesn't allow writing to the device.
+}
+
+var null:text;
+
+begin
+{$ifdef Unix}
+  assign(null,'/dev/null');
+{$else}
+  assign(null,'NUL');
+{$endif}
+  append(null);
+  writeln(null,'Text disappearing into the black hole.');
+  close(null);
+end.