add test case for: chars > 127 were being read incorrectly in cfactor

cvs
Slava Pestov 2004-09-03 03:00:30 +00:00
parent eaacbf635e
commit c0dfdfb23b
3 changed files with 15 additions and 4 deletions

View File

@ -48,7 +48,7 @@ USE: httpd-responder
wiki-word-regexp re-matches ;
: wiki-word-links ( str -- str )
wiki-word-regexp "$1" "$1" link-tag re-replace ;
wiki-word-regexp "$1" "$1" re-replace ;
: get-wiki-page ( name -- text )
"wiki" get [ get ] bind ;
@ -70,7 +70,7 @@ USE: httpd-responder
: wiki-footer ( name -- )
"<hr>" print
"Edit" swap "edit?" swap cat2 link-tag write ;
"Edit" swap "edit?" swap cat2 write ;
: serve-existing-page ( name text -- )
over [ write-wiki-page wiki-footer ] html-document ;

View File

@ -0,0 +1 @@
<EFBFBD>

View File

@ -4,11 +4,13 @@ USE: parser
USE: stack
USE: streams
USE: test
USE: stdio
USE: math
[ 4 ] [ "/library/test/io/no-trailing-eol.factor" run-resource ] unit-test
: lines-test ( stream -- line1 line2 )
dup freadln swap dup freadln swap fclose ;
[ read read ] with-stream ;
[
"This is a line."
@ -27,5 +29,13 @@ USE: test
[
"This is a line.\rThis is another line.\r"
] [
500 "/library/test/io/mac-os-eol.txt" <resource-stream> fread#
"/library/test/io/mac-os-eol.txt" <resource-stream>
[ 500 read# ] with-stream
] unit-test
[
255
] [
"/library/test/io/binary.txt" <resource-stream>
[ read1 ] with-stream >fixnum
] unit-test