aboutsummaryrefslogtreecommitdiff
path: root/tests/utils.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-04-28 21:38:40 +0200
committerLudovic Courtès <ludo@gnu.org>2013-04-28 23:19:03 +0200
commit2bcfb9e065ac6abb6abf7ac9a263ba3c4d70124f (patch)
tree2b68896d8f18ed5b1b67c982f9677c84066b357c /tests/utils.scm
parent19cb51701266404e023eda5a50c026bccb0dc6a0 (diff)
downloadgnu-guix-2bcfb9e065ac6abb6abf7ac9a263ba3c4d70124f.tar
gnu-guix-2bcfb9e065ac6abb6abf7ac9a263ba3c4d70124f.tar.gz
utils: Add `string-tokenize*'.
* guix/utils.scm (string-tokenize*): New procedure. * tests/utils.scm ("string-tokenize*"): New test.
Diffstat (limited to 'tests/utils.scm')
-rw-r--r--tests/utils.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/utils.scm b/tests/utils.scm
index fa7d7b03fd..97547a6d62 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -64,6 +64,16 @@
("nixpkgs" "1.0pre22125_a28fe19")
("gtk2" "2.38.0"))))
+(test-equal "string-tokenize*"
+ '(("foo")
+ ("foo" "bar" "baz")
+ ("foo" "bar" "")
+ ("foo" "bar" "baz"))
+ (list (string-tokenize* "foo" ":")
+ (string-tokenize* "foo;bar;baz" ";")
+ (string-tokenize* "foo!bar!" "!")
+ (string-tokenize* "foo+-+bar+-+baz" "+-+")))
+
(test-equal "fold2, 1 list"
(list (reverse (iota 5))
(map - (reverse (iota 5))))