From 35c8dd9bfa0e8b43b86a073e7ecd8b4b3ba95e4d Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Sat, 19 May 2018 13:20:56 +1000 Subject: [PATCH] Adding tests for String.join and String.join-with Issue #94 --- test/string.carp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/string.carp b/test/string.carp index 1db39648..dc6e5ad1 100644 --- a/test/string.carp +++ b/test/string.carp @@ -197,6 +197,26 @@ &(split-by "erikmsvedlhejxfoo" &[\m \l \x]) "split-by works correctly" ) + (assert-equal test + "hello world" + &(join &[@"hello" @" " @"world"]) + "join works correctly" + ) + (assert-equal test + "hello world" + &(join-with "" &[@"hello" @" " @"world"]) + "join-with works correctly I" + ) + (assert-equal test + "hello world" + &(join-with " " &[@"hello" @"world"]) + "join-with works correctly II" + ) + (assert-equal test + "hello aaaa there aaaa world" + &(join-with " aaaa " &[@"hello" @"there" @"world"]) + "join-with works correctly III" + ) (print-test-results test) ) )