Skip to content

Commit

Permalink
Tests stream file position
Browse files Browse the repository at this point in the history
  • Loading branch information
t-sin committed Jun 11, 2017
1 parent 6be965d commit 8fb4340
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions t/inquisitor.lisp
Expand Up @@ -29,10 +29,11 @@
(is-error (detect-encoding in :jp) 'error))

(with-open-file (in (asdf:system-relative-pathname
:inquisitor "t/data/ascii/ascii-lf.txt")
:inquisitor "t/data/unicode/utf-8.txt")
:direction :input
:element-type '(unsigned-byte 8))
(is (detect-encoding in :jp) :utf-8)))
(is (detect-encoding in :jp) :utf-8)
(is (file-position in) (file-length in))))

(subtest "for pathname"
(is (detect-encoding (asdf:system-relative-pathname
Expand All @@ -52,10 +53,13 @@
:direction :input)
(is-error (detect-end-of-line in) 'error))

(with-open-file (in (asdf:system-relative-pathname :inquisitor "t/data/ascii/ascii-lf.txt")
(with-open-file (in (asdf:system-relative-pathname
:inquisitor "t/data/unicode/utf-8.txt")
:direction :input
:element-type '(unsigned-byte 8))
(is (detect-end-of-line in) :lf)))
(is (detect-end-of-line in) :lf)
(diag "is this check valid?")
(is (file-position in) (file-length in))))

(subtest "for pathname"
(is (detect-end-of-line (asdf:system-relative-pathname :inquisitor "t/data/ascii/ascii-lf.txt"))
Expand Down

0 comments on commit 8fb4340

Please sign in to comment.