diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2022-07-03 14:37:10 -0700 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2022-07-03 14:37:10 -0700 |
| commit | bcb098e8eb18637b6999789585a38ff9168de9d5 (patch) | |
| tree | fe2bee9fcc5cac8c2f8362c836901f7a3643cb03 /csc/strings-test.csc | |
| parent | Write closure conversion. (diff) | |
| download | chromatopelma-bcb098e8eb18637b6999789585a38ff9168de9d5.tar.zst | |
Add a diff library.
I was hesitant to add a diff library, but it was surprisingly easy. A
straightforward application of dynamic programming.
Diffstat (limited to 'csc/strings-test.csc')
| -rw-r--r-- | csc/strings-test.csc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/csc/strings-test.csc b/csc/strings-test.csc index 2e6d240..49f8d20 100644 --- a/csc/strings-test.csc +++ b/csc/strings-test.csc @@ -44,6 +44,30 @@ (assert (not-found-error? got-exception)))) +(test contains + (assert-equal + #t + (contains "abc" "b"))) + + +(test doesnt-contain + (assert-equal + #f + (contains "abc" "d"))) + + +(test contains-empty + (assert-equal + #t + (contains "" ""))) + + +(test empty-contains + (assert-equal + #f + (contains "" "a"))) + + (test join-, (assert-equal "a,b,c" (join "," "a" "b" "c"))) @@ -58,3 +82,14 @@ (test join-empty (assert-equal "abc" (join "" "a" "b" "c"))) + + +(test split-empty + (assert-equal '("") (split "" " "))) + +(test split + (assert-equal '("a" "b") (split "a b" " "))) + + +(test split-trailing-empty + (assert-equal '("a" "") (split "a " " "))) |
