add test case for: chars > 127 were being read incorrectly in cfactor
parent
eaacbf635e
commit
c0dfdfb23b
|
@ -48,7 +48,7 @@ USE: httpd-responder
|
||||||
wiki-word-regexp re-matches ;
|
wiki-word-regexp re-matches ;
|
||||||
|
|
||||||
: wiki-word-links ( str -- str )
|
: 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 )
|
: get-wiki-page ( name -- text )
|
||||||
"wiki" get [ get ] bind ;
|
"wiki" get [ get ] bind ;
|
||||||
|
@ -70,7 +70,7 @@ USE: httpd-responder
|
||||||
|
|
||||||
: wiki-footer ( name -- )
|
: wiki-footer ( name -- )
|
||||||
"<hr>" print
|
"<hr>" print
|
||||||
"Edit" swap "edit?" swap cat2 link-tag write ;
|
"Edit" swap "edit?" swap cat2 write ;
|
||||||
|
|
||||||
: serve-existing-page ( name text -- )
|
: serve-existing-page ( name text -- )
|
||||||
over [ write-wiki-page wiki-footer ] html-document ;
|
over [ write-wiki-page wiki-footer ] html-document ;
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<EFBFBD>
|
|
@ -4,11 +4,13 @@ USE: parser
|
||||||
USE: stack
|
USE: stack
|
||||||
USE: streams
|
USE: streams
|
||||||
USE: test
|
USE: test
|
||||||
|
USE: stdio
|
||||||
|
USE: math
|
||||||
|
|
||||||
[ 4 ] [ "/library/test/io/no-trailing-eol.factor" run-resource ] unit-test
|
[ 4 ] [ "/library/test/io/no-trailing-eol.factor" run-resource ] unit-test
|
||||||
|
|
||||||
: lines-test ( stream -- line1 line2 )
|
: lines-test ( stream -- line1 line2 )
|
||||||
dup freadln swap dup freadln swap fclose ;
|
[ read read ] with-stream ;
|
||||||
|
|
||||||
[
|
[
|
||||||
"This is a line."
|
"This is a line."
|
||||||
|
@ -27,5 +29,13 @@ USE: test
|
||||||
[
|
[
|
||||||
"This is a line.\rThis is another line.\r"
|
"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
|
] unit-test
|
||||||
|
|
Loading…
Reference in New Issue