aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/test
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/test')
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/primitive.lux61
1 files changed, 0 insertions, 61 deletions
diff --git a/new-luxc/test/test/luxc/lang/analysis/primitive.lux b/new-luxc/test/test/luxc/lang/analysis/primitive.lux
deleted file mode 100644
index aa3e30aab..000000000
--- a/new-luxc/test/test/luxc/lang/analysis/primitive.lux
+++ /dev/null
@@ -1,61 +0,0 @@
-(.module:
- lux
- (lux [io]
- (control [monad #+ do]
- pipe)
- (data (text format)
- ["e" error])
- ["r" math/random]
- [macro]
- (macro [code])
- (lang [type "type/" Eq<Type>])
- test)
- (luxc ["&" lang]
- (lang ["&." module]
- ["~" analysis]
- (analysis [".A" expression]
- ["@" primitive]
- ["@." common])))
- (// common)
- (test/luxc common))
-
-(context: "Primitives"
- (<| (times +100)
- (do @
- [%bool% r.bool
- %nat% r.nat
- %int% r.int
- %deg% r.deg
- %frac% r.frac
- %text% (r.text +5)]
- (`` ($_ seq
- (test "Can analyse unit."
- (|> (@common.with-unknown-type
- @.analyse-unit)
- (macro.run (io.run init-jvm))
- (case> (^ (#e.Success [_type (^code [])]))
- (type/= Top _type)
-
- _
- false))
- )
- (~~ (do-template [<desc> <type> <tag> <value> <analyser>]
- [(test (format "Can analyse " <desc> ".")
- (|> (@common.with-unknown-type
- (<analyser> <value>))
- (macro.run (io.run init-jvm))
- (case> (#e.Success [_type [_ (<tag> value)]])
- (and (type/= <type> _type)
- (is? <value> value))
-
- _
- false))
- )]
-
- ["bool" Bool #.Bool %bool% @.analyse-bool]
- ["nat" Nat #.Nat %nat% @.analyse-nat]
- ["int" Int #.Int %int% @.analyse-int]
- ["deg" Deg #.Deg %deg% @.analyse-deg]
- ["frac" Frac #.Frac %frac% @.analyse-frac]
- ["text" Text #.Text %text% @.analyse-text]
- )))))))