]> gitweb.factorcode.org Git - factor.git/blob - basis/io/crlf/crlf-tests.factor
821d3a79312f86a36d28d9525509c72e3c01a542
[factor.git] / basis / io / crlf / crlf-tests.factor
1 IN: io.crlf.tests
2 USING: io.crlf tools.test io.streams.string io ;
3
4 [ "Hello, world." ] [ "Hello, world." [ read-crlf ] with-string-reader ] unit-test
5 [ "Hello, world." ] [ "Hello, world.\r\n" [ read-crlf ] with-string-reader ] unit-test
6 [ "Hello, world.\r" [ read-crlf ] with-string-reader ] must-fail
7 [ f ] [ "" [ read-crlf ] with-string-reader ] unit-test
8 [ "" ] [ "\r\n" [ read-crlf ] with-string-reader ] unit-test
9
10 [ "foo\r" [ read-?crlf ] with-string-reader ] must-fail
11 [ f ] [ "" [ read-?crlf ] with-string-reader ] unit-test
12 [ "" ] [ "\n" [ read-?crlf ] with-string-reader ] unit-test
13 [ "foo" ] [ "foo\n" [ read-?crlf ] with-string-reader ] unit-test
14
15 [ "foo\nbar" ] [ "foo\n\rbar" crlf>lf ] unit-test
16 [ "foo\r\nbar" ] [ "foo\nbar" lf>crlf ] unit-test