aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2017-11-15 20:24:28 -0400
committerEduardo Julian2017-11-15 20:24:28 -0400
commitaf1417bf28529a8fec06901d586b60b41bba8f76 (patch)
treeebcd48b978598c4237a51876ed343f2bbcd6dcfe
parent296d087530cb142efec1dea159770346bb43c3c0 (diff)
- Got the tests to run again.
Diffstat (limited to '')
-rw-r--r--new-luxc/test/test/luxc/common.lux4
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/case.lux8
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/common.lux6
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/function.lux8
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/primitive.lux6
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/procedure/common.lux16
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/procedure/host.jvm.lux12
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/reference.lux6
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/structure.lux42
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/type.lux10
-rw-r--r--new-luxc/test/test/luxc/lang/syntax.lux48
-rw-r--r--new-luxc/test/test/luxc/lang/translation/primitive.lux4
-rw-r--r--new-luxc/test/test/luxc/lang/translation/procedure/host.jvm.lux4
-rw-r--r--new-luxc/test/test/luxc/lang/translation/reference.lux10
-rw-r--r--new-luxc/test/test/luxc/lang/translation/structure.lux4
15 files changed, 93 insertions, 95 deletions
diff --git a/new-luxc/test/test/luxc/common.lux b/new-luxc/test/test/luxc/common.lux
index 84d912145..1215e669f 100644
--- a/new-luxc/test/test/luxc/common.lux
+++ b/new-luxc/test/test/luxc/common.lux
@@ -1,8 +1,8 @@
(;module:
lux
(lux [io])
- (luxc ["&;" host]
- (lang [";L" translation])))
+ (luxc (lang ["&;" host]
+ [";L" translation])))
(def: #export (init-compiler _)
(-> Top Compiler)
diff --git a/new-luxc/test/test/luxc/lang/analysis/case.lux b/new-luxc/test/test/luxc/lang/analysis/case.lux
index 66646754e..ee8b9b74d 100644
--- a/new-luxc/test/test/luxc/lang/analysis/case.lux
+++ b/new-luxc/test/test/luxc/lang/analysis/case.lux
@@ -17,12 +17,12 @@
[type "type/" Eq<Type>]
(type ["tc" check]))
test)
- (luxc ["&" base]
- (lang ["la" analysis]
+ (luxc ["&" lang]
+ (lang ["@;" module]
+ ["la" analysis]
(analysis [";A" expression]
["@" case]
- ["@;" common]))
- ["@;" module])
+ ["@;" common])))
(.. common)
(test/luxc common))
diff --git a/new-luxc/test/test/luxc/lang/analysis/common.lux b/new-luxc/test/test/luxc/lang/analysis/common.lux
index 937ed4cda..086a0bd31 100644
--- a/new-luxc/test/test/luxc/lang/analysis/common.lux
+++ b/new-luxc/test/test/luxc/lang/analysis/common.lux
@@ -5,9 +5,9 @@
(data ["e" error])
[meta]
(meta [code]))
- (luxc ["&" base]
- (lang (analysis [";A" expression]))
- [eval])
+ (luxc ["&" lang]
+ (lang (analysis [";A" expression])
+ [eval]))
(test/luxc common))
(def: gen-unit
diff --git a/new-luxc/test/test/luxc/lang/analysis/function.lux b/new-luxc/test/test/luxc/lang/analysis/function.lux
index 1a2f13458..e08e7a9bd 100644
--- a/new-luxc/test/test/luxc/lang/analysis/function.lux
+++ b/new-luxc/test/test/luxc/lang/analysis/function.lux
@@ -14,12 +14,12 @@
(meta [code]
[type "type/" Eq<Type>])
test)
- (luxc ["&" base]
- (lang ["la" analysis]
+ (luxc ["&" lang]
+ (lang ["@;" module]
+ ["la" analysis]
(analysis [";A" expression]
["@" function]
- ["@;" common]))
- ["@;" module])
+ ["@;" common])))
(.. common)
(test/luxc common))
diff --git a/new-luxc/test/test/luxc/lang/analysis/primitive.lux b/new-luxc/test/test/luxc/lang/analysis/primitive.lux
index 41dc9fada..8e1329eb6 100644
--- a/new-luxc/test/test/luxc/lang/analysis/primitive.lux
+++ b/new-luxc/test/test/luxc/lang/analysis/primitive.lux
@@ -16,9 +16,9 @@
(meta [code]
[type "type/" Eq<Type>])
test)
- (luxc ["&" base]
- ["&;" module]
- (lang ["~" analysis]
+ (luxc ["&" lang]
+ (lang ["&;" module]
+ ["~" analysis]
(analysis [";A" expression]
["@" primitive]
["@;" common])))
diff --git a/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux b/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux
index b992ca2d6..dae39228f 100644
--- a/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux
+++ b/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux
@@ -13,14 +13,14 @@
(meta [code]
[type "type/" Eq<Type>])
test)
- (luxc ["&" base]
- ["&;" scope]
- ["&;" module]
- [";L" eval]
- (lang ["~" analysis]
+ (luxc ["&" lang]
+ (lang ["&;" scope]
+ ["&;" module]
+ ["~" analysis]
(analysis [";A" expression]
["@" procedure]
- ["@;" common])))
+ ["@;" common])
+ [";L" eval]))
(../.. common)
(test/luxc common))
@@ -243,9 +243,9 @@
(test "Can replace a text inside of a larger one (all times)."
(check-success+ "lux text replace-all" (list subjectC paramC replacementC) Text))
(test "Can obtain the character code of a text at a given index."
- (check-success+ "lux text char" (list subjectC fromC) Nat))
+ (check-success+ "lux text char" (list subjectC fromC) (type (Maybe Nat))))
(test "Can clip a piece of text between 2 indices."
- (check-success+ "lux text clip" (list subjectC fromC toC) Text))
+ (check-success+ "lux text clip" (list subjectC fromC toC) (type (Maybe Text))))
))))
(context: "Array procedures"
diff --git a/new-luxc/test/test/luxc/lang/analysis/procedure/host.jvm.lux b/new-luxc/test/test/luxc/lang/analysis/procedure/host.jvm.lux
index 0f8848a21..3d5da350a 100644
--- a/new-luxc/test/test/luxc/lang/analysis/procedure/host.jvm.lux
+++ b/new-luxc/test/test/luxc/lang/analysis/procedure/host.jvm.lux
@@ -17,16 +17,16 @@
(meta [code]
[type])
test)
- (luxc ["&" base]
- ["&;" scope]
- ["&;" module]
- [";L" eval]
- (lang ["~" analysis]
+ (luxc ["&" lang]
+ (lang ["&;" scope]
+ ["&;" module]
+ ["~" analysis]
(analysis [";A" expression]
["@;" common]
["@" procedure]
(procedure ["@;" host]))
- (translation ["@;" runtime])))
+ (translation ["@;" runtime])
+ [";L" eval]))
(../.. common)
(test/luxc common))
diff --git a/new-luxc/test/test/luxc/lang/analysis/reference.lux b/new-luxc/test/test/luxc/lang/analysis/reference.lux
index f6021e184..15e5af44f 100644
--- a/new-luxc/test/test/luxc/lang/analysis/reference.lux
+++ b/new-luxc/test/test/luxc/lang/analysis/reference.lux
@@ -8,9 +8,9 @@
[meta #+ Monad<Meta>]
(meta [type "type/" Eq<Type>])
test)
- (luxc ["&;" scope]
- ["&;" module]
- (lang ["~" analysis]
+ (luxc (lang ["&;" scope]
+ ["&;" module]
+ ["~" analysis]
(analysis [";A" expression]
["@" reference]
["@;" common])))
diff --git a/new-luxc/test/test/luxc/lang/analysis/structure.lux b/new-luxc/test/test/luxc/lang/analysis/structure.lux
index 507b61995..b299872ca 100644
--- a/new-luxc/test/test/luxc/lang/analysis/structure.lux
+++ b/new-luxc/test/test/luxc/lang/analysis/structure.lux
@@ -17,12 +17,12 @@
[type "type/" Eq<Type>]
(type ["tc" check]))
test)
- (luxc ["&" base]
- (lang ["la" analysis]
+ (luxc ["&" lang]
+ (lang ["@;" module]
+ ["la" analysis]
(analysis [";A" expression]
["@" structure]
- ["@;" common]))
- ["@;" module])
+ ["@;" common])))
(.. common)
(test/luxc common))
@@ -58,13 +58,12 @@
false)))
(test "Can analyse sum through bound type-vars."
(|> (&;with-scope
- (@common;with-var
- (function [[var-id varT]]
- (do meta;Monad<Meta>
- [_ (&;with-type-env
- (tc;check varT variantT))]
- (&;with-expected-type varT
- (@;analyse-sum analyse choice valueC))))))
+ (do meta;Monad<Meta>
+ [[_ varT] (&;with-type-env tc;var)
+ _ (&;with-type-env
+ (tc;check varT variantT))]
+ (&;with-expected-type varT
+ (@;analyse-sum analyse choice valueC))))
(meta;run (init-compiler []))
(case> (^multi (#e;Success [_ sumA])
[(la;unfold-variant sumA)
@@ -76,10 +75,10 @@
false)))
(test "Cannot analyse sum through unbound type-vars."
(|> (&;with-scope
- (@common;with-var
- (function [[var-id varT]]
- (&;with-expected-type varT
- (@;analyse-sum analyse choice valueC)))))
+ (do meta;Monad<Meta>
+ [[_ varT] (&;with-type-env tc;var)]
+ (&;with-expected-type varT
+ (@;analyse-sum analyse choice valueC))))
(meta;run (init-compiler []))
(case> (#e;Success _)
false
@@ -152,13 +151,12 @@
false)))
(test "Can analyse product through bound type-vars."
(|> (&;with-scope
- (@common;with-var
- (function [[var-id varT]]
- (do meta;Monad<Meta>
- [_ (&;with-type-env
- (tc;check varT (type;tuple (list/map product;left primitives))))]
- (&;with-expected-type varT
- (@;analyse-product analyse (list/map product;right primitives)))))))
+ (do meta;Monad<Meta>
+ [[_ varT] (&;with-type-env tc;var)
+ _ (&;with-type-env
+ (tc;check varT (type;tuple (list/map product;left primitives))))]
+ (&;with-expected-type varT
+ (@;analyse-product analyse (list/map product;right primitives)))))
(meta;run (init-compiler []))
(case> (#e;Success [_ tupleA])
(n.= size (list;size (la;unfold-tuple tupleA)))
diff --git a/new-luxc/test/test/luxc/lang/analysis/type.lux b/new-luxc/test/test/luxc/lang/analysis/type.lux
index e93068ea3..6d89582e8 100644
--- a/new-luxc/test/test/luxc/lang/analysis/type.lux
+++ b/new-luxc/test/test/luxc/lang/analysis/type.lux
@@ -16,14 +16,14 @@
(meta [code]
[type "type/" Eq<Type>])
test)
- (luxc ["&" base]
- ["&;" module]
- (lang ["~" analysis]
+ (luxc ["&" lang]
+ (lang ["&;" module]
+ ["~" analysis]
(analysis [";A" expression]
["@" type]
["@;" common])
- (translation ["@;" runtime]))
- [eval])
+ (translation ["@;" runtime])
+ [eval]))
(.. common)
(test/luxc common))
diff --git a/new-luxc/test/test/luxc/lang/syntax.lux b/new-luxc/test/test/luxc/lang/syntax.lux
index 195fed2ca..0f2306eb1 100644
--- a/new-luxc/test/test/luxc/lang/syntax.lux
+++ b/new-luxc/test/test/luxc/lang/syntax.lux
@@ -80,20 +80,20 @@
other code^]
($_ seq
(test "Can parse Lux code."
- (case (&;parse [default-cursor +0 (code;to-text sample)])
+ (case (&;parse "" [default-cursor +0 (code;to-text sample)])
(#e;Error error)
false
(#e;Success [_ parsed])
(:: code;Eq<Code> = parsed sample)))
(test "Can parse Lux multiple code nodes."
- (case (&;parse [default-cursor +0 (format (code;to-text sample) " "
- (code;to-text other))])
+ (case (&;parse "" [default-cursor +0 (format (code;to-text sample) " "
+ (code;to-text other))])
(#e;Error error)
false
(#e;Success [remaining =sample])
- (case (&;parse remaining)
+ (case (&;parse "" remaining)
(#e;Error error)
false
@@ -114,11 +114,11 @@
signed? r;bool
#let [expected (|> numerator (f./ denominator) (f.* (if signed? -1.0 1.0)))]]
(test "Can parse frac ratio syntax."
- (case (&;parse [default-cursor +0
- (format (if signed? "-" "")
- (%i (frac-to-int numerator))
- "/"
- (%i (frac-to-int denominator)))])
+ (case (&;parse "" [default-cursor +0
+ (format (if signed? "-" "")
+ (%i (frac-to-int numerator))
+ "/"
+ (%i (frac-to-int denominator)))])
(#e;Success [_ [_ (#;Frac actual)]])
(f.= expected actual)
@@ -131,8 +131,8 @@
(do @
[expected (|> r;nat (:: @ map (n.% +1_000)))]
(test "Can parse nat char syntax."
- (case (&;parse [default-cursor +0
- (format "#" (%t (text;from-code expected)) "")])
+ (case (&;parse "" [default-cursor +0
+ (format "#" (%t (text;from-code expected)) "")])
(#e;Success [_ [_ (#;Nat actual)]])
(n.= expected actual)
@@ -181,8 +181,8 @@
(let [bad-match (format (text;from-code x) "\n"
(text;from-code y) "\n"
(text;from-code z))]
- (case (&;parse [default-cursor +0
- (format "\"" bad-match "\"")])
+ (case (&;parse "" [default-cursor +0
+ (format "\"" bad-match "\"")])
(#e;Error error)
true
@@ -195,9 +195,9 @@
good-output (format (text;from-code x) "\n"
(text;from-code y) "\n"
(text;from-code z))]
- (case (&;parse [(|> default-cursor (update@ #;column (n.+ (n.dec offset-size))))
- +0
- (format "\"" good-input "\"")])
+ (case (&;parse "" [(|> default-cursor (update@ #;column (n.+ (n.dec offset-size))))
+ +0
+ (format "\"" good-input "\"")])
(#e;Error error)
false
@@ -206,25 +206,25 @@
parsed
(code;text good-output)))))
(test "Can handle comments."
- (case (&;parse [default-cursor +0
- (format comment (code;to-text sample))])
+ (case (&;parse "" [default-cursor +0
+ (format comment (code;to-text sample))])
(#e;Error error)
false
(#e;Success [_ parsed])
(:: code;Eq<Code> = parsed sample)))
(test "Will reject unbalanced multi-line comments."
- (and (case (&;parse [default-cursor +0
- (format "#(" "#(" unbalanced-comment ")#"
- (code;to-text sample))])
+ (and (case (&;parse "" [default-cursor +0
+ (format "#(" "#(" unbalanced-comment ")#"
+ (code;to-text sample))])
(#e;Error error)
true
(#e;Success [_ parsed])
false)
- (case (&;parse [default-cursor +0
- (format "#(" unbalanced-comment ")#" ")#"
- (code;to-text sample))])
+ (case (&;parse "" [default-cursor +0
+ (format "#(" unbalanced-comment ")#" ")#"
+ (code;to-text sample))])
(#e;Error error)
true
diff --git a/new-luxc/test/test/luxc/lang/translation/primitive.lux b/new-luxc/test/test/luxc/lang/translation/primitive.lux
index e8aaddb5a..40e98f109 100644
--- a/new-luxc/test/test/luxc/lang/translation/primitive.lux
+++ b/new-luxc/test/test/luxc/lang/translation/primitive.lux
@@ -11,8 +11,8 @@
[meta]
(meta [code])
test)
- (luxc [";L" host]
- (lang ["ls" synthesis]
+ (luxc (lang [";L" host]
+ ["ls" synthesis]
(translation [";T" expression]
["@;" runtime]
["@;" eval]
diff --git a/new-luxc/test/test/luxc/lang/translation/procedure/host.jvm.lux b/new-luxc/test/test/luxc/lang/translation/procedure/host.jvm.lux
index 0dd539120..c2b699ff2 100644
--- a/new-luxc/test/test/luxc/lang/translation/procedure/host.jvm.lux
+++ b/new-luxc/test/test/luxc/lang/translation/procedure/host.jvm.lux
@@ -16,8 +16,8 @@
(meta [code])
[host]
test)
- (luxc [";L" host]
- (lang ["ls" synthesis]
+ (luxc (lang [";L" host]
+ ["ls" synthesis]
(translation [";T" expression]
["@;" eval]
["@;" runtime]
diff --git a/new-luxc/test/test/luxc/lang/translation/reference.lux b/new-luxc/test/test/luxc/lang/translation/reference.lux
index 1aee7df46..50d6cffbf 100644
--- a/new-luxc/test/test/luxc/lang/translation/reference.lux
+++ b/new-luxc/test/test/luxc/lang/translation/reference.lux
@@ -9,15 +9,15 @@
[meta]
(meta [code])
test)
- (luxc (host ["$" jvm]
- (jvm ["$i" inst]))
- (lang ["ls" synthesis]
+ (luxc (lang ["_;" module]
+ (host ["$" jvm]
+ (jvm ["$i" inst]))
+ ["ls" synthesis]
(translation [";T" statement]
[";T" eval]
[";T" expression]
[";T" case]
- [";T" runtime]))
- ["_;" module])
+ [";T" runtime])))
(test/luxc common))
(def: nilI $;Inst runtimeT;noneI)
diff --git a/new-luxc/test/test/luxc/lang/translation/structure.lux b/new-luxc/test/test/luxc/lang/translation/structure.lux
index f32ab40e1..d8f7bc98f 100644
--- a/new-luxc/test/test/luxc/lang/translation/structure.lux
+++ b/new-luxc/test/test/luxc/lang/translation/structure.lux
@@ -15,8 +15,8 @@
(meta [code])
[host]
test)
- (luxc [";L" host]
- (lang ["ls" synthesis]
+ (luxc (lang [";L" host]
+ ["ls" synthesis]
(translation [";T" expression]
["@;" eval]
["@;" runtime]