]> gitweb.factorcode.org Git - factor.git/commitdiff
wrap.words: make it work with empty input.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 20 Sep 2015 16:44:17 +0000 (09:44 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 20 Sep 2015 16:44:17 +0000 (09:44 -0700)
basis/wrap/words/words-tests.factor
basis/wrap/words/words.factor

index 0d3116678e5b22ca9e2d0c534fbf5c09bb7a5970..4781a095eb7cd77a21382df9707c9bd02b462a62 100644 (file)
@@ -3,6 +3,9 @@
 USING: tools.test wrap.words sequences ;
 IN: wrap.words.tests
 
+{ { } } [ f 35 35 wrap-words ] unit-test
+{ { } } [ { } 35 35 wrap-words ] unit-test
+
 {
     {
         {
index a8d87f75d50c1b6bdfa342c020ee7086311d3620..48a73243f51c192654ad3afcc22c410f006e7c59 100644 (file)
@@ -33,7 +33,7 @@ C: <wrapping-word> wrapping-word
     [ prefix ] when* ;
 
 : words>elements ( seq -- newseq )
-    split-words ?first-break make-elements ;
+    [ { } ] [ split-words ?first-break make-elements ] if-empty ;
 
 PRIVATE>