Merge pull request #457 from hellerve/fix-string-words

Also split by newline in String.words
This commit is contained in:
Erik Svedäng 2019-05-27 10:41:47 +02:00 committed by GitHub
commit a34752413e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ If you want to replace all occurrences of the pattern, use `-1`.")
(doc words "splits a string into words.") (doc words "splits a string into words.")
(defn words [s] (defn words [s]
(split-by s &[\tab \space])) (split-by s &[\tab \space \newline]))
(doc lines "splits a string into lines.") (doc lines "splits a string into lines.")
(defn lines [s] (defn lines [s]

View File

@ -179,7 +179,7 @@
"collapse-whitespace works as expected") "collapse-whitespace works as expected")
(assert-equal test (assert-equal test
&[@"erik" @"sved" @"hej" @"foo"] &[@"erik" @"sved" @"hej" @"foo"]
&(words "erik sved hej\tfoo") &(words "erik sved\nhej\tfoo")
"words works correctly") "words works correctly")
(assert-equal test (assert-equal test
&[@"erik" @"sved" @"hej" @"foo"] &[@"erik" @"sved" @"hej" @"foo"]