diff options
author | Eduardo Julian | 2017-10-26 17:27:12 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-10-26 17:27:12 -0400 |
commit | cb54d53f06cb8d047e1460f0a9db63a594c5baf9 (patch) | |
tree | 535eb964a0c02f31934ca251c220df26327b4e08 /new-luxc | |
parent | 0f96338dae4b8a9970b052c99954b2fd08a896eb (diff) |
- Fixed tests for analysis of common procedures.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/analyser/procedure/common.lux | 3 | ||||
-rw-r--r-- | new-luxc/test/test/luxc/analyser/procedure/common.lux | 17 |
2 files changed, 11 insertions, 9 deletions
diff --git a/new-luxc/source/luxc/analyser/procedure/common.lux b/new-luxc/source/luxc/analyser/procedure/common.lux index 04aa35e05..6c2e810b5 100644 --- a/new-luxc/source/luxc/analyser/procedure/common.lux +++ b/new-luxc/source/luxc/analyser/procedure/common.lux @@ -214,7 +214,8 @@ (install "index" (trinary Text Text Nat (type (Maybe Nat)))) (install "size" (unary Text Nat)) (install "hash" (unary Text Nat)) - (install "replace" (trinary Text Text Text Text)) + (install "replace-once" (trinary Text Text Text Text)) + (install "replace-all" (trinary Text Text Text Text)) (install "char" (binary Text Nat Nat)) (install "clip" (trinary Text Nat Nat Text)) ))) diff --git a/new-luxc/test/test/luxc/analyser/procedure/common.lux b/new-luxc/test/test/luxc/analyser/procedure/common.lux index 208076d6e..8649de3d7 100644 --- a/new-luxc/test/test/luxc/analyser/procedure/common.lux +++ b/new-luxc/test/test/luxc/analyser/procedure/common.lux @@ -26,13 +26,14 @@ (do-template [<name> <success> <failure>] [(def: (<name> procedure params output-type) (-> Text (List Code) Type Bool) - (|> (&;with-expected-type output-type - (@;analyse-procedure analyse procedure params)) + (|> (&;with-scope + (&;with-expected-type output-type + (@;analyse-procedure analyse procedure params))) (meta;run (init-compiler [])) (case> (#e;Success _) <success> - (#e;Error _) + (#e;Error error) <failure>)))] [check-success+ true false] @@ -52,7 +53,7 @@ (check-failure+ "lux is" (list primC antiC) Bool)) (test "Can 'try' risky IO computations." (check-success+ "lux try" - (list (` ((~' _lux_function) (~' _) (~' _) (~ primC)))) + (list (` ("lux function" (~' _) (~' _) (~ primC)))) (type (Either Text primT)))) )))) @@ -169,7 +170,7 @@ (test "Can scale degree." (check-success+ "lux deg scale" (list subjectC natC) Deg)) (test "Can calculate the reciprocal of a natural number." - (check-success+ "lux deg reciprocal" (list natC) Deg)) + (check-success+ "lux deg reciprocal" (list subjectC natC) Deg)) )))) (context: "Frac procedures" @@ -212,7 +213,7 @@ (test "Can convert frac number to text." (check-success+ "lux frac encode" (list subjectC) Text)) (test "Can convert text to frac number." - (check-success+ "lux frac encode" (list encodedC) (type (Maybe Frac)))) + (check-success+ "lux frac decode" (list encodedC) (type (Maybe Frac)))) )))) (context: "Text procedures" @@ -395,12 +396,12 @@ (check-success+ "lux process concurrency-level" (list) Nat)) (test "Can run an IO computation concurrently." (check-success+ "lux process future" - (list (` ((~' _lux_function) (~' _) (~' _) (~ primC)))) + (list (` ("lux function" (~' _) (~' _) (~ primC)))) Unit)) (test "Can schedule an IO computation to run concurrently at some future time." (check-success+ "lux process schedule" (list timeC - (` ((~' _lux_function) (~' _) (~' _) (~ primC)))) + (` ("lux function" (~' _) (~' _) (~ primC)))) Unit)) )))) |