* tests/ports.test: in seek/tell test on input port, also test
authorGary Houston <ghouston@arglist.com>
Wed, 20 Oct 1999 20:59:07 +0000 (20:59 +0000)
committerGary Houston <ghouston@arglist.com>
Wed, 20 Oct 1999 20:59:07 +0000 (20:59 +0000)
that ftell doesn't discard unread chars.

test-suite/ChangeLog
test-suite/tests/ports.test

index 32f7d8f..00a7704 100644 (file)
@@ -1,3 +1,8 @@
+1999-10-20  Gary Houston  <ghouston@freewire.co.uk>
+
+       * tests/ports.test: in seek/tell test on input port, also test
+       that ftell doesn't discard unread chars.
+
 1999-10-18  Gary Houston  <ghouston@freewire.co.uk>
 
        * tests/ports.test: add seek/tell tests for unidirectional ports.
index a6f0ca5..9787a0f 100644 (file)
      (read-char iport)
      (pass-if "file: in tell 1"
              (= (seek iport 0 SEEK_CUR) 1))
+     (unread-char #\z iport)
+     (pass-if "file: in tell 0 after unread"
+             (= (seek iport 0 SEEK_CUR) 0))
+     (pass-if "file: unread char still there"
+             (char=? (read-char iport) #\z))
      (seek iport 7 SEEK_SET)
      (pass-if "file: in last char"
              (char=? (read-char iport) #\x))