splitting: Support SBUF" " with split-lines. Fixes #575. Thanks @mrjbq7
for the patch.
parent
9663be7585
commit
2e6050bf54
|
|
@ -58,6 +58,18 @@ unit-test
|
||||||
[ { "hello" "hi" } ] [ "hello\rhi" string-lines ] unit-test
|
[ { "hello" "hi" } ] [ "hello\rhi" string-lines ] unit-test
|
||||||
[ { "hello" "hi" } ] [ "hello\r\nhi" string-lines ] unit-test
|
[ { "hello" "hi" } ] [ "hello\r\nhi" string-lines ] unit-test
|
||||||
|
|
||||||
|
[ { SBUF" " } ] [ SBUF" " string-lines ] unit-test
|
||||||
|
[ { SBUF" " SBUF" " } ] [ SBUF" \n" string-lines ] unit-test
|
||||||
|
[ { SBUF" " SBUF" " } ] [ SBUF" \r" string-lines ] unit-test
|
||||||
|
[ { SBUF" " SBUF" " } ] [ SBUF" \r\n" string-lines ] unit-test
|
||||||
|
[ { SBUF" hello" } ] [ SBUF" hello" string-lines ] unit-test
|
||||||
|
[ { SBUF" hello" SBUF" " } ] [ SBUF" hello\n" string-lines ] unit-test
|
||||||
|
[ { SBUF" hello" SBUF" " } ] [ SBUF" hello\r" string-lines ] unit-test
|
||||||
|
[ { SBUF" hello" SBUF" " } ] [ SBUF" hello\r\n" string-lines ] unit-test
|
||||||
|
[ { SBUF" hello" SBUF" hi" } ] [ SBUF" hello\nhi" string-lines ] unit-test
|
||||||
|
[ { SBUF" hello" SBUF" hi" } ] [ SBUF" hello\rhi" string-lines ] unit-test
|
||||||
|
[ { SBUF" hello" SBUF" hi" } ] [ SBUF" hello\r\nhi" string-lines ] unit-test
|
||||||
|
|
||||||
[ { "hey" "world" "what's" "happening" } ]
|
[ { "hey" "world" "what's" "happening" } ]
|
||||||
[ "heyAworldBwhat'sChappening" [ LETTER? ] split-when ] unit-test
|
[ "heyAworldBwhat'sChappening" [ LETTER? ] split-when ] unit-test
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (C) 2005, 2009 Slava Pestov.
|
! Copyright (C) 2005, 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: arrays kernel make math sequences strings ;
|
USING: arrays kernel make math sequences strings sbufs ;
|
||||||
IN: splitting
|
IN: splitting
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
@ -120,3 +120,6 @@ M: string string-lines
|
||||||
] [
|
] [
|
||||||
1array
|
1array
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
|
M: sbuf string-lines
|
||||||
|
[ "" like string-lines ] keep [ like ] curry map ;
|
||||||
Loading…
Reference in New Issue