Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hoosierEE committed Aug 6, 2024
1 parent 0446d73 commit 6316302
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions proto2/Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ def test_expr(scan,parse):
x = """
input ⇒ expected output (in s-expr form)
⇒ None
#
# projection/composition/application
#
a+ ⇒ (prj + a)
+- ⇒ (cmp + (prj -))
(+)- ⇒ (prj - +)
Expand Down Expand Up @@ -41,7 +43,14 @@ def test_expr(scan,parse):
(+/)/y ⇒ (app (/ (/ +)) y)
x(+/)y ⇒ (app x (app (/ +) y))
(-a)*b ⇒ (* (- a) b)
#
# dicts
#
[a:1; b:2] ⇒ ([ (: a 1) (: b 2))
`a`b!1 2 ⇒ (! (vec `a `b) (vec 1 2))
#
# lists
#
(;) ⇒ (⋯ ∅ ∅)
(;b) ⇒ (⋯ ∅ b)
(a) ⇒ a
Expand Down Expand Up @@ -116,6 +125,9 @@ def test_expr(scan,parse):
x f//y ⇒ (app (/ (/ f)) x y)
x f/y ⇒ (app (/ f) x y)
x{f}/y ⇒ (app (/ (λ f)) x y)
#
# lambdas
#
{()()} ⇒ (λ (app (⋯ ∅) (⋯ ∅)))
{()} ⇒ (λ (⋯ ∅))
{(x)y} ⇒ (λ (app x y))
Expand Down

0 comments on commit 6316302

Please sign in to comment.