aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/test
diff options
context:
space:
mode:
authorEduardo Julian2018-05-16 01:06:28 -0400
committerEduardo Julian2018-05-16 01:06:28 -0400
commit273c2d517dbafbe6df4d9b9ac65ffd4749e63642 (patch)
tree03cd1d8db4fa575f557bea6d82167399c6e04752 /new-luxc/test
parent8ba6ac8952e3457b1a09e30ac5312168d48006d1 (diff)
- Migrated reference analysis to stdlib.
Diffstat (limited to '')
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/reference.lux52
1 files changed, 0 insertions, 52 deletions
diff --git a/new-luxc/test/test/luxc/lang/analysis/reference.lux b/new-luxc/test/test/luxc/lang/analysis/reference.lux
deleted file mode 100644
index 9ce4a51c1..000000000
--- a/new-luxc/test/test/luxc/lang/analysis/reference.lux
+++ /dev/null
@@ -1,52 +0,0 @@
-(.module:
- lux
- (lux [io]
- (control [monad #+ do]
- pipe)
- (data ["e" error])
- ["r" math/random]
- [macro #+ Monad<Meta>]
- (lang [type "type/" Eq<Type>])
- test)
- (luxc (lang ["&." scope]
- ["&." module]
- ["~" analysis]
- (analysis [".A" expression]
- ["@" reference]
- ["@." common])))
- (// common)
- (test/luxc common))
-
-(context: "References"
- (<| (times +100)
- (do @
- [[ref-type _] gen-primitive
- module-name (r.text +5)
- scope-name (r.text +5)
- var-name (r.text +5)]
- ($_ seq
- (test "Can analyse variable."
- (|> (&scope.with-scope scope-name
- (&scope.with-local [var-name ref-type]
- (@common.with-unknown-type
- (@.analyse-reference ["" var-name]))))
- (macro.run (io.run init-jvm))
- (case> (^ (#e.Success [_type (^code ((~ [_ (#.Int var)])))]))
- (type/= ref-type _type)
-
- _
- false)))
- (test "Can analyse definition."
- (|> (do Monad<Meta>
- [_ (&module.create +0 module-name)
- _ (&module.define [module-name var-name]
- [ref-type (' {}) (:! Bottom [])])]
- (@common.with-unknown-type
- (@.analyse-reference [module-name var-name])))
- (macro.run (io.run init-jvm))
- (case> (#e.Success [_type [_ (#.Symbol def-name)]])
- (type/= ref-type _type)
-
- _
- false)))
- ))))