1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-18 17:27:40 +00:00

Address issue #180 - string/check-set

Fix the function and add test to further clarify that
implementation is correct. Also fix empty string case.
This commit is contained in:
Calvin Rose
2019-11-25 20:27:08 -06:00
parent 6bc400eb8c
commit 74d51ab08b
2 changed files with 5 additions and 4 deletions

View File

@@ -132,8 +132,9 @@
(assert (string/check-set "abc" "a") "string/check-set 1")
(assert (not (string/check-set "abc" "z")) "string/check-set 2")
(assert (string/check-set "abc" "abc") "string/check-set 3")
(assert (not (string/check-set "abc" "")) "string/check-set 4")
(assert (string/check-set "abc" "") "string/check-set 4")
(assert (not (string/check-set "" "aabc")) "string/check-set 5")
(assert (not (string/check-set "abc" "abcdefg")) "string/check-set 6")
# Marshal and unmarshal pegs
(def p (-> "abcd" peg/compile marshal unmarshal))