aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
authorEduardo Julian2018-07-31 22:23:07 -0400
committerEduardo Julian2018-07-31 22:23:07 -0400
commit97ab1f076ac08992d6b64cd77bc0bef97b3fc50a (patch)
tree6ea01c3e9f5be6a1387c1a7621681d1642176329 /stdlib/test
parent7e44ee8a2cfb14e35f6283a9eb8d6a2ddc8bd99a (diff)
Now implementing array functionality in stdlib instead of the compiler.
Diffstat (limited to 'stdlib/test')
-rw-r--r--stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux75
1 files changed, 0 insertions, 75 deletions
diff --git a/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux
index 9d733912e..20eeaf2eb 100644
--- a/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux
+++ b/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux
@@ -170,81 +170,6 @@
(check-success+ "lux text clip" (list subjectC fromC toC) (type (Maybe Text))))
))))
-(context: "Array procedures"
- (<| (times 100)
- (do @
- [[elemT elemC] _primitive.primitive
- sizeC (|> r.nat (:: @ map code.nat))
- idxC (|> r.nat (:: @ map code.nat))
- var-name (r.unicode 5)
- #let [arrayT (type (Array elemT))
- g!array (code.local-identifier var-name)
- array-operation (function (_ output-type code)
- (|> (scope.with-scope ""
- (scope.with-local [var-name arrayT]
- (typeA.with-type output-type
- (_primitive.analyse code))))
- (phase.run [analysisE.bundle (init.compiler [])])
- (case> (#e.Success _)
- #1
-
- (#e.Error error)
- #0)))]]
- ($_ seq
- (test "Can create arrays."
- (check-success+ "lux array new" (list sizeC) arrayT))
- (test "Can get a value inside an array."
- (array-operation (type (Maybe elemT))
- (` ("lux array get" (~ g!array) (~ idxC)))))
- (test "Can put a value inside an array."
- (array-operation arrayT
- (` ("lux array put" (~ g!array) (~ idxC) (~ elemC)))))
- (test "Can remove a value from an array."
- (array-operation arrayT
- (` ("lux array remove" (~ g!array) (~ idxC)))))
- (test "Can query the size of an array."
- (array-operation Nat
- (` ("lux array size" (~ g!array)))))
- ))))
-
-(context: "Atom procedures"
- (<| (times 100)
- (do @
- [[elemT elemC] _primitive.primitive
- sizeC (|> r.nat (:: @ map code.nat))
- idxC (|> r.nat (:: @ map code.nat))
- var-name (r.unicode 5)
- #let [atomT (type (atom.Atom elemT))]]
- ($_ seq
- (test "Can create atomic reference."
- (check-success+ "lux atom new" (list elemC) atomT))
- (test "Can read the value of an atomic reference."
- (|> (scope.with-scope ""
- (scope.with-local [var-name atomT]
- (typeA.with-type elemT
- (_primitive.analyse (` ("lux atom read" (~ (code.identifier ["" var-name]))))))))
- (phase.run [analysisE.bundle (init.compiler [])])
- (case> (#e.Success _)
- #1
-
- (#e.Error _)
- #0)))
- (test "Can swap the value of an atomic reference."
- (|> (scope.with-scope ""
- (scope.with-local [var-name atomT]
- (typeA.with-type Bit
- (_primitive.analyse (` ("lux atom compare-and-swap"
- (~ (code.identifier ["" var-name]))
- (~ elemC)
- (~ elemC)))))))
- (phase.run [analysisE.bundle (init.compiler [])])
- (case> (#e.Success _)
- #1
-
- (#e.Error _)
- #0)))
- ))))
-
(context: "IO procedures"
(<| (times 100)
(do @