From 2bcfb9e065ac6abb6abf7ac9a263ba3c4d70124f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 28 Apr 2013 21:38:40 +0200 Subject: utils: Add `string-tokenize*'. * guix/utils.scm (string-tokenize*): New procedure. * tests/utils.scm ("string-tokenize*"): New test. --- tests/utils.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/utils.scm') 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)))) -- cgit v1.2.3