diff options
Diffstat (limited to 'stdlib/test')
-rw-r--r-- | stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux | 75 |
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 @ |