aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test
diff options
context:
space:
mode:
authorEduardo Julian2021-09-08 03:08:13 -0400
committerEduardo Julian2021-09-08 03:08:13 -0400
commit392582885500d8201bbe502943ca4b02c5c77ac0 (patch)
tree6e7410546048547560c767dba9c303d3f2f9597a /stdlib/source/test
parent609cc6c16e75c13d87183c38245136fa038b0496 (diff)
Normalized the syntax of "abstract:" and "actor:".
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/control/concurrency/actor.lux14
-rw-r--r--stdlib/source/test/lux/type/abstract.lux126
2 files changed, 67 insertions, 73 deletions
diff --git a/stdlib/source/test/lux/control/concurrency/actor.lux b/stdlib/source/test/lux/control/concurrency/actor.lux
index b2603fc0d..7616ea1a9 100644
--- a/stdlib/source/test/lux/control/concurrency/actor.lux
+++ b/stdlib/source/test/lux/control/concurrency/actor.lux
@@ -28,17 +28,15 @@
(exception: got_wrecked)
(actor: counter
- {}
-
Nat
- ((on_mail message state self)
- (message state self))
+ [((on_mail message state self)
+ (message state self))
- (message: (count! {increment Nat} state self)
- Nat
- (let [state' (n.+ increment state)]
- (async\in (#try.Success [state' state']))))
+ (message: (count! {increment Nat} state self)
+ Nat
+ (let [state' (n.+ increment state)]
+ (async\in (#try.Success [state' state']))))]
)
(def: (mailed? outcome)
diff --git a/stdlib/source/test/lux/type/abstract.lux b/stdlib/source/test/lux/type/abstract.lux
index 66bee2f43..9004d7fbe 100644
--- a/stdlib/source/test/lux/type/abstract.lux
+++ b/stdlib/source/test/lux/type/abstract.lux
@@ -47,71 +47,67 @@
(with_expansions [no_current! (..with_no_active_frames (..current))
no_specific! (..with_no_active_frames (..specific))]
(/.abstract: (g!Foo a)
- {}
-
Text
- (/.abstract: (g!Bar a)
- {}
-
- Nat
+ [(/.abstract: (g!Bar a)
+ Nat
- (def: .public test
- Test
- (<| (_.covering /._)
- (_.for [/.abstract:])
- (do random.monad
- [expected_foo (random.ascii/lower 5)
- expected_bar random.nat]
- ($_ _.and
- (_.cover [/.:abstraction]
- (and (exec (: (g!Foo Text)
- (/.:abstraction g!Foo expected_foo))
- true)
- (exec (: (g!Bar Text)
- (/.:abstraction expected_bar))
- true)))
- (_.cover [/.:representation]
- (and (|> expected_foo
- (/.:abstraction g!Foo)
- (: (g!Foo Bit))
- (/.:representation g!Foo)
- (text\= expected_foo))
- (|> (/.:abstraction expected_bar)
- (: (g!Bar Bit))
- /.:representation
- (n.= expected_bar))))
- (_.cover [/.:transmutation]
- (and (exec (|> expected_foo
- (/.:abstraction g!Foo)
- (: (g!Foo .Macro))
- (/.:transmutation g!Foo)
- (: (g!Foo .Lux)))
- true)
- (exec (|> (/.:abstraction expected_bar)
- (: (g!Bar .Macro))
- /.:transmutation
- (: (g!Bar .Lux)))
- true)))
- (_.cover [/.^:representation]
- (and (let [(/.^:representation g!Foo actual_foo)
- (: (g!Foo .Module)
- (/.:abstraction g!Foo expected_foo))]
- (text\= expected_foo actual_foo))
- (let [(/.^:representation actual_bar)
- (: (g!Bar .Module)
- (/.:abstraction expected_bar))]
- (n.= expected_bar actual_bar))))
- (_.for [/.Frame]
- ($_ _.and
- (_.cover [/.current]
- (text\= (template.text [g!Bar])
- (..current)))
- (_.cover [/.specific]
- (text\= (template.text [g!Foo])
- (..specific)))
- (_.cover [/.no_active_frames]
- (and no_current!
- no_specific!))
- ))
- )))))))))
+ [(def: .public test
+ Test
+ (<| (_.covering /._)
+ (_.for [/.abstract:])
+ (do random.monad
+ [expected_foo (random.ascii/lower 5)
+ expected_bar random.nat]
+ ($_ _.and
+ (_.cover [/.:abstraction]
+ (and (exec (: (g!Foo Text)
+ (/.:abstraction g!Foo expected_foo))
+ true)
+ (exec (: (g!Bar Text)
+ (/.:abstraction expected_bar))
+ true)))
+ (_.cover [/.:representation]
+ (and (|> expected_foo
+ (/.:abstraction g!Foo)
+ (: (g!Foo Bit))
+ (/.:representation g!Foo)
+ (text\= expected_foo))
+ (|> (/.:abstraction expected_bar)
+ (: (g!Bar Bit))
+ /.:representation
+ (n.= expected_bar))))
+ (_.cover [/.:transmutation]
+ (and (exec (|> expected_foo
+ (/.:abstraction g!Foo)
+ (: (g!Foo .Macro))
+ (/.:transmutation g!Foo)
+ (: (g!Foo .Lux)))
+ true)
+ (exec (|> (/.:abstraction expected_bar)
+ (: (g!Bar .Macro))
+ /.:transmutation
+ (: (g!Bar .Lux)))
+ true)))
+ (_.cover [/.^:representation]
+ (and (let [(/.^:representation g!Foo actual_foo)
+ (: (g!Foo .Module)
+ (/.:abstraction g!Foo expected_foo))]
+ (text\= expected_foo actual_foo))
+ (let [(/.^:representation actual_bar)
+ (: (g!Bar .Module)
+ (/.:abstraction expected_bar))]
+ (n.= expected_bar actual_bar))))
+ (_.for [/.Frame]
+ ($_ _.and
+ (_.cover [/.current]
+ (text\= (template.text [g!Bar])
+ (..current)))
+ (_.cover [/.specific]
+ (text\= (template.text [g!Foo])
+ (..specific)))
+ (_.cover [/.no_active_frames]
+ (and no_current!
+ no_specific!))
+ ))
+ ))))])]))))