-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement destruct functions; tag 0.7.9
- Loading branch information
Showing
12 changed files
with
123 additions
and
86 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "calcit" | ||
version = "0.7.8" | ||
version = "0.7.9" | ||
authors = ["jiyinyiyong <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
{} (:package |test-tuple) | ||
:configs $ {} (:init-fn |test-tuple.main/main!) (:reload-fn |test-tuple.main/reload!) | ||
:files $ {} | ||
|test-tuple.main $ {} | ||
:ns $ quote | ||
ns test-tuple.main $ :require | ||
util.core :refer $ log-title | ||
:defs $ {} | ||
|
||
|main! $ quote | ||
defn main! () | ||
log-title "|Testing tuple" | ||
|
||
assert= | ||
:: :parts |1 |23 | ||
tag-match (destruct-str "|123") | ||
(:none) (:: :empty) | ||
(:some s0 ss) (:: :parts s0 ss) | ||
|
||
assert= | ||
:: :empty | ||
tag-match (destruct-str "|") | ||
(:none) (:: :empty) | ||
(:some s0 ss) (:: :parts s0 ss) | ||
|
||
assert= | ||
:: :parts 1 $ [] 2 3 | ||
tag-match (destruct-list $ [] 1 2 3) | ||
(:none) (:: :empty) | ||
(:some l0 ls) (:: :parts l0 ls) | ||
|
||
assert= | ||
:: :empty | ||
tag-match (destruct-list $ []) | ||
(:none) (:: :empty) | ||
(:some l0 ls) (:: :parts l0 ls) | ||
|
||
assert= | ||
:: :parts true 2 | ||
tag-match (destruct-set $ #{} 1 2 3) | ||
(:none) (:: :empty) | ||
(:some l0 ls) (:: :parts (number? l0) (count ls)) | ||
|
||
assert= | ||
:: :empty | ||
tag-match (destruct-set $ #{}) | ||
(:none) (:: :empty) | ||
(:some l0 ls) (:: :parts (number? l0) (count ls)) | ||
|
||
assert= | ||
:: :empty | ||
tag-match (destruct-map $ &{}) | ||
(:none) (:: :empty) | ||
(:some m0 ms) (:: :parts (count m0) (count ms)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.