1
0
mirror of https://github.com/janet-lang/janet synced 2026-06-03 19:22:24 +00:00

Add test case for dollar suffix match.

This commit is contained in:
Calvin Rose
2025-11-30 08:47:01 -06:00
parent d9105299f1
commit be2a1ddf96
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
## Unreleased - ???
- Add `thaw-keep-keys` as a variant of thaw
- The `repl` function now respects the `*repl-prompt*` dynamic binding.
- Allow matching exact lengths of datastructures with the `match` macro using a dollar suffix.
## 1.40.1 - 2025-11-16
- Fix `JANET_REDUCED_OS` build regression caused by `os/posix-chroot`.
+4
View File
@@ -191,5 +191,9 @@
(assert (deep= (thaw ds1) (thaw-keep-keys ds1)) "thaw vs. thaw-keep-keys 1")
(assert (deep-not= (thaw ds2) (thaw-keep-keys ds2)) "thaw vs. thaw-keep-keys 2")
# match
(assert (= :yes (match [1 2 3] [x y z w] :no1 [x y $] :no2 [x y z] :yes)) "match dollar suffix 1")
(assert (= :yes (match [1 2 3] [x y z w] :no1 [x y z $] :yes [x y z] :no2)) "match dollar suffix 2")
(end-suite)