anoia: add assert macro module

contains expect and expect=
This commit is contained in:
Daniel Barlow
2024-04-20 14:04:32 +01:00
parent 0f0688c802
commit 7e19d80130
4 changed files with 37 additions and 9 deletions

View File

@@ -1,9 +1,10 @@
(local { : hash : base64url } (require :anoia))
(import-macros { : expect= } :anoia.assert)
(assert (= (hash "") 5381))
(expect= (hash "") 5381)
;; these examples from https://theartincode.stanis.me/008-djb2/
(assert (= (hash "Hello") 210676686969))
(assert (= (hash "Hello!") 6952330670010))
(expect= (hash "Hello") 210676686969)
(expect= (hash "Hello!") 6952330670010)
(assert (= (base64url "hello world") "aGVsbG8gd29ybGQ"))
(expect= (base64url "hello world") "aGVsbG8gd29ybGQ")