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\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" } ]
|
||||
[ "heyAworldBwhat'sChappening" [ LETTER? ] split-when ] unit-test
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2005, 2009 Slava Pestov.
|
||||
! 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
|
||||
|
||||
<PRIVATE
|
||||
|
|
@ -120,3 +120,6 @@ M: string string-lines
|
|||
] [
|
||||
1array
|
||||
] if ;
|
||||
|
||||
M: sbuf string-lines
|
||||
[ "" like string-lines ] keep [ like ] curry map ;
|
||||
Loading…
Reference in New Issue