diff options
Diffstat (limited to 'new-luxc/test')
9 files changed, 60 insertions, 60 deletions
diff --git a/new-luxc/test/test/luxc/lang/analysis/host.jvm.lux b/new-luxc/test/test/luxc/lang/analysis/host.jvm.lux index 02574a31a..1e6cafdfc 100644 --- a/new-luxc/test/test/luxc/lang/analysis/host.jvm.lux +++ b/new-luxc/test/test/luxc/lang/analysis/host.jvm.lux @@ -35,7 +35,7 @@ (do-template [<name> <success> <failure>] [(def: (<name> procedure params output-type) - (-> Text (List Code) Type Bool) + (-> Text (List Code) Type Bit) (|> (do Monad<Meta> [## runtime-bytecode @runtime.translate ] @@ -56,7 +56,7 @@ (do-template [<name> <success> <failure>] [(def: (<name> syntax output-type) - (-> Code Type Bool) + (-> Code Type Bit) (|> (do Monad<Meta> [## runtime-bytecode @runtime.translate ] @@ -365,7 +365,7 @@ (test "jvm object null?" (success "jvm object null?" (list boxedC) - Bool)) + Bit)) (test "jvm object synchronized" (success "jvm object synchronized" (list boxedC boxedC) @@ -388,18 +388,18 @@ (success "jvm object instance?" (list (code.text boxed) boxedC) - Bool)) + Bit)) (test "jvm object instance? (lineage)" (success "jvm object instance?" (list (' "java.lang.Object") boxedC) - Bool)) + Bit)) (test "jvm object instance? (no lineage)" (or (text/= "java.lang.Object" boxed) (failure "jvm object instance?" (list (code.text boxed) !boxedC) - Bool))) + Bit))) )))) (context: "Member [Static Field]." diff --git a/new-luxc/test/test/luxc/lang/analysis/type.lux b/new-luxc/test/test/luxc/lang/analysis/type.lux index a026f8df2..b2d819ec5 100644 --- a/new-luxc/test/test/luxc/lang/analysis/type.lux +++ b/new-luxc/test/test/luxc/lang/analysis/type.lux @@ -3,7 +3,7 @@ (lux [io] (control [monad #+ do] pipe) - (data [bool "bool/" Eq<Bool>] + (data [bit "bit/" Eq<Bit>] [text "text/" Eq<Text>] (text format ["l" lexer]) @@ -36,7 +36,7 @@ <type> (<code> value)]))] - [r.bool (+0 "#Bool" (+0)) code.bool] + [r.bit (+0 "#Bit" (+0)) code.bit] [r.nat (+0 "#Nat" (+0)) code.nat] [r.int (+0 "#Int" (+0)) code.int] [r.rev (+0 "#Rev" (+0)) code.rev] @@ -65,7 +65,7 @@ (^template [<tag> <test>] [[_ (<tag> expected)] [_ (<tag> actual)]] (<test> expected actual)) - ([#.Bool bool/=] + ([#.Bit bit/=] [#.Nat n/=] [#.Int i/=] [#.Rev r/=] diff --git a/new-luxc/test/test/luxc/lang/synthesis/loop.lux b/new-luxc/test/test/luxc/lang/synthesis/loop.lux index 23641780f..af818255b 100644 --- a/new-luxc/test/test/luxc/lang/synthesis/loop.lux +++ b/new-luxc/test/test/luxc/lang/synthesis/loop.lux @@ -2,7 +2,7 @@ lux (lux [io] (control [monad #+ do]) - (data [bool "bool/" Eq<Bool>] + (data [bit "bit/" Eq<Bit>] [number] (coll [list "list/" Functor<List> Fold<List>] (set ["set" unordered])) @@ -18,7 +18,7 @@ (// common)) (def: (does-recursion? arity exprS) - (-> ls.Arity ls.Synthesis Bool) + (-> ls.Arity ls.Synthesis Bit) (loop [exprS exprS] (case exprS (^ [_ (#.Form (list [_ (#.Text "lux case")] inputS pathS))]) @@ -68,19 +68,19 @@ (wrap (` ("lux case" (~ inputA) (~ (code.record (list.zip2 tests bodies)))))))) (r.either (do r.Monad<Random> - [valueS r.bool + [valueS r.bit output' (gen-body (n/inc arity) output)] - (wrap (` ("lux case" (~ (code.bool valueS)) + (wrap (` ("lux case" (~ (code.bit valueS)) {("lux case bind" (~ (code.nat arity))) (~ output')})))) (do r.Monad<Random> - [valueS r.bool - then|else r.bool + [valueS r.bit + then|else r.bit output' (gen-body arity output) #let [thenA (if then|else output' (' [])) elseA (if (not then|else) output' (' []))]] - (wrap (` ("lux case" (~ (code.bool valueS)) - {(~ (code.bool then|else)) (~ thenA) - (~ (code.bool (not then|else))) (~ elseA)}))))) + (wrap (` ("lux case" (~ (code.bit valueS)) + {(~ (code.bit then|else)) (~ thenA) + (~ (code.bit (not then|else))) (~ elseA)}))))) )) (def: (make-function arity body) @@ -90,14 +90,14 @@ _ (` ("lux function" [] (~ (make-function (n/dec arity) body)))))) (def: gen-recursion - (r.Random [Bool Nat la.Analysis]) + (r.Random [Bit Nat la.Analysis]) (do r.Monad<Random> [arity (|> r.nat (:: @ map (|>> (n/% +10) (n/max +1)))) - recur? r.bool + recur? r.bit outputS (if recur? (wrap (la.apply (list.repeat arity (' [])) (la.var 0))) (do @ - [plus-or-minus? r.bool + [plus-or-minus? r.bit how-much (|> r.nat (:: @ map (|>> (n/% arity) (n/max +1)))) #let [shift (if plus-or-minus? n/+ n/-)]] (wrap (la.apply (list.repeat (shift how-much arity) (' [])) (la.var 0))))) @@ -105,17 +105,17 @@ (wrap [recur? arity (make-function arity bodyS)]))) (def: gen-loop - (r.Random [Bool Nat la.Analysis]) + (r.Random [Bit Nat la.Analysis]) (do r.Monad<Random> [arity (|> r.nat (:: @ map (|>> (n/% +10) (n/max +1)))) - recur? r.bool - self-ref? r.bool + recur? r.bit + self-ref? r.bit #let [selfA (la.var 0) argA (if self-ref? selfA (' []))] outputS (if recur? (wrap (la.apply (list.repeat arity argA) selfA)) (do @ - [plus-or-minus? r.bool + [plus-or-minus? r.bit how-much (|> r.nat (:: @ map (|>> (n/% arity) (n/max +1)))) #let [shift (if plus-or-minus? n/+ n/-)]] (wrap (la.apply (list.repeat (shift how-much arity) (' [])) selfA)))) @@ -135,7 +135,7 @@ (^ [_ (#.Form (list [_ (#.Text "lux function")] [_ (#.Nat _arity)] [_ (#.Tuple _env)] _body))]) (|> _body (does-recursion? arity) - (bool/= prediction) + (bit/= prediction) (and (n/= arity _arity))) _ diff --git a/new-luxc/test/test/luxc/lang/translation/case.lux b/new-luxc/test/test/luxc/lang/translation/case.lux index a16715729..20d072651 100644 --- a/new-luxc/test/test/luxc/lang/translation/case.lux +++ b/new-luxc/test/test/luxc/lang/translation/case.lux @@ -14,7 +14,7 @@ (def: struct-limit Nat +10) (def: (tail? size idx) - (-> Nat Nat Bool) + (-> Nat Nat Bit) (n/= (n/dec size) idx)) (def: gen-case @@ -31,7 +31,7 @@ (wrap [(<synth> value) (<path> value)]))] - [r.bool //synthesis.bool //synthesis.path/bool] + [r.bit //synthesis.bit //synthesis.path/bit] [r.int //synthesis.i64 //synthesis.path/i64] [r.frac //synthesis.f64 //synthesis.path/f64] [(r.unicode +5) //synthesis.text //synthesis.path/text])) @@ -51,7 +51,7 @@ [size (|> r.nat (:: @ map (|>> (n/% struct-limit) (n/max +2)))) idx (|> r.nat (:: @ map (n/% size))) [subS subP] gen-case - #let [caseS (` ((~ (code.nat idx)) (~ (code.bool (tail? size idx))) (~ subS))) + #let [caseS (` ((~ (code.nat idx)) (~ (code.bit (tail? size idx))) (~ subS))) caseP (` ("lux case seq" (~ (if (tail? size idx) (` ("lux case variant right" (~ (code.nat idx)))) @@ -74,7 +74,7 @@ ("lux case seq" ("lux case bind" +0) ("lux case exec" false)))))) (case> (#e.Success valueT) - (:coerce Bool valueT) + (:coerce Bit valueT) (#e.Error error) (exec (log! error) diff --git a/new-luxc/test/test/luxc/lang/translation/common.lux b/new-luxc/test/test/luxc/lang/translation/common.lux index 0e2d66503..9aba56d6b 100644 --- a/new-luxc/test/test/luxc/lang/translation/common.lux +++ b/new-luxc/test/test/luxc/lang/translation/common.lux @@ -6,7 +6,7 @@ (data text/format [bit] ["e" error] - [bool "bool/" Eq<Bool>] + [bit "bit/" Eq<Bit>] [text "text/" Eq<Text>] [number "int/" Number<Int> "frac/" Number<Frac> Interval<Frac>] (coll ["a" array] @@ -100,8 +100,8 @@ ["lux int *" i/* Int i/=] ["lux int /" i// Int i/=] ["lux int %" i/% Int i/=] - ["lux int =" i/= Bool bool/=] - ["lux int <" i/< Bool bool/=] + ["lux int =" i/= Bit bit/=] + ["lux int <" i/< Bit bit/=] )) )))) @@ -124,8 +124,8 @@ ["lux frac *" f/* Frac f/=] ["lux frac /" f// Frac f/=] ["lux frac %" f/% Frac f/=] - ["lux frac =" f/= Bool bool/=] - ["lux frac <" f/< Bool bool/=] + ["lux frac =" f/= Bit bit/=] + ["lux frac <" f/< Bit bit/=] )] ($_ seq <binary> @@ -202,20 +202,20 @@ (test "Can compare texts for equality." (and (|> (run (` ("lux text =" (~ sample0S) (~ sample0S)))) (case> (#e.Success valueV) - (:coerce Bool valueV) + (:coerce Bit valueV) _ false)) (|> (run (` ("lux text =" (~ sample0S) (~ sample1S)))) (case> (#e.Success valueV) - (not (:coerce Bool valueV)) + (not (:coerce Bit valueV)) _ false)))) (test "Can compare texts for order." (|> (run (` ("lux text <" (~ sample1S) (~ sample0S)))) (case> (#e.Success valueV) - (:coerce Bool valueV) + (:coerce Bit valueV) _ false))) @@ -423,7 +423,7 @@ [("lux atom compare-and-swap" (1) (0) (~ postS)) ("lux atom read" (1))])))) (case> (#e.Success valueV) - (let [[swapped? current-value] (:coerce [Bool Nat] valueV)] + (let [[swapped? current-value] (:coerce [Bit Nat] valueV)] (and swapped? (n/= post current-value))) @@ -435,7 +435,7 @@ [("lux atom compare-and-swap" (1) (~ postS) (~ postS)) ("lux atom read" (1))])))) (case> (#e.Success valueV) - (let [[swapped? current-value] (:coerce [Bool Nat] valueV)] + (let [[swapped? current-value] (:coerce [Bit Nat] valueV)] (and (not swapped?) (n/= pre current-value))) diff --git a/new-luxc/test/test/luxc/lang/translation/js.lux b/new-luxc/test/test/luxc/lang/translation/js.lux index 6f4fb572d..42947b580 100644 --- a/new-luxc/test/test/luxc/lang/translation/js.lux +++ b/new-luxc/test/test/luxc/lang/translation/js.lux @@ -20,15 +20,15 @@ (|> r.nat (:: r.Functor<Random> map (|>> (n/% +91) (n/max +65))))) (def: (test-primitive-identity synthesis) - (-> Synthesis Bool) + (-> Synthesis Bit) (|> (run-js (` ("lux is" (~ synthesis) (~ synthesis)))) (case> (#e.Success valueV) - (:coerce Bool valueV) + (:coerce Bit valueV) _ false))) -(type: Check (-> (e.Error Any) Bool)) +(type: Check (-> (e.Error Any) Bit)) (do-template [<name> <type> <pre> <=>] [(def: (<name> angle) diff --git a/new-luxc/test/test/luxc/lang/translation/jvm.lux b/new-luxc/test/test/luxc/lang/translation/jvm.lux index 6652c8484..34f1af508 100644 --- a/new-luxc/test/test/luxc/lang/translation/jvm.lux +++ b/new-luxc/test/test/luxc/lang/translation/jvm.lux @@ -6,7 +6,7 @@ (data [maybe] ["e" error] [bit] - [bool "bool/" Eq<Bool>] + [bit "bit/" Eq<Bit>] [number "int/" Number<Int> Codec<Text,Int>] [text "text/" Eq<Text>] text/format @@ -242,8 +242,8 @@ (lang.with-current-module "") (macro.run (io.run init-jvm)) (case> (#e.Success valueT) - (bool/= (<reference> param subject) - (:coerce Bool valueT)) + (bit/= (<reference> param subject) + (:coerce Bit valueT)) (#e.Error error) false)))] @@ -279,7 +279,7 @@ (do @ [size (|> r.nat (:: @ map (|>> (n/% +10) (n/max +1)))) idx (|> r.nat (:: @ map (n/% size))) - valueZ r.bool + valueZ r.bit valueB gen-int valueS gen-int valueI gen-int @@ -303,7 +303,7 @@ (#e.Error error) false)))] - ["boolean" Bool valueZ bool/= (code.bool valueZ) + ["boolean" Bit valueZ bit/= (code.bit valueZ) id] ["byte" Int valueB i/= (|> (code.int valueB) (~) "jvm convert long-to-byte" (`)) "jvm convert byte-to-long"] @@ -327,7 +327,7 @@ (do @ [size (|> r.nat (:: @ map (|>> (n/% +10) (n/max +1)))) idx (|> r.nat (:: @ map (n/% size))) - valueZ r.bool + valueZ r.bit valueB gen-int valueS gen-int valueI gen-int @@ -401,7 +401,7 @@ (def: instances (List [Text (r.Random ls.Synthesis)]) - (let [gen-boolean (|> r.bool (:: r.Functor<Random> map code.bool)) + (let [gen-boolean (|> r.bit (:: r.Functor<Random> map code.bit)) gen-integer (|> r.int (:: r.Functor<Random> map code.int)) gen-double (|> r.frac (:: r.Functor<Random> map code.frac)) gen-string (|> (r.text +5) (:: r.Functor<Random> map code.text))] @@ -436,7 +436,7 @@ (lang.with-current-module "") (macro.run (io.run init-jvm)) (case> (#e.Success outputT) - (:coerce Bool outputT) + (:coerce Bit outputT) (#e.Error error) false))) @@ -447,7 +447,7 @@ (lang.with-current-module "") (macro.run (io.run init-jvm)) (case> (#e.Success outputT) - (not (:coerce Bool outputT)) + (not (:coerce Bit outputT)) (#e.Error error) false))) @@ -500,7 +500,7 @@ (lang.with-current-module "") (macro.run (io.run init-jvm)) (case> (#e.Success outputT) - (:coerce Bool outputT) + (:coerce Bit outputT) (#e.Error error) false))) @@ -610,7 +610,7 @@ (lang.with-current-module "") (macro.run (io.run init-jvm)) (case> (#e.Success outputT) - (:coerce Bool outputT) + (:coerce Bit outputT) (#e.Error error) false))) @@ -623,7 +623,7 @@ (lang.with-current-module "") (macro.run (io.run init-jvm)) (case> (#e.Success outputT) - (:coerce Bool outputT) + (:coerce Bit outputT) (#e.Error error) false))) diff --git a/new-luxc/test/test/luxc/lang/translation/primitive.lux b/new-luxc/test/test/luxc/lang/translation/primitive.lux index 43886e197..a58b3b97e 100644 --- a/new-luxc/test/test/luxc/lang/translation/primitive.lux +++ b/new-luxc/test/test/luxc/lang/translation/primitive.lux @@ -5,7 +5,7 @@ pipe) (data text/format ["e" error] - [bool "bool/" Eq<Bool>] + [bit "bit/" Eq<Bit>] [text "text/" Eq<Text>]) ["r" math/random] (lang ["//." synthesis]) @@ -16,7 +16,7 @@ (def: (spec run) (-> Runner Test) (do r.Monad<Random> - [%bool% r.bool + [%bit% r.bit %nat% r.nat %int% r.int %rev% r.rev @@ -33,7 +33,7 @@ (exec (log! error) false))))] - ["bool" Bool //synthesis.bool %bool% bool/=] + ["bit" Bit //synthesis.bit %bit% bit/=] ["int" Int //synthesis.i64 %int% i/=] ["frac" Frac //synthesis.f64 %frac% f/=] ["text" Text //synthesis.text %text% text/=])) diff --git a/new-luxc/test/test/luxc/lang/translation/structure.lux b/new-luxc/test/test/luxc/lang/translation/structure.lux index df1350395..17068bb72 100644 --- a/new-luxc/test/test/luxc/lang/translation/structure.lux +++ b/new-luxc/test/test/luxc/lang/translation/structure.lux @@ -5,7 +5,7 @@ pipe) (data ["e" error] [maybe] - [bool "bool/" Eq<Bool>] + [bit "bit/" Eq<Bit>] [text "text/" Eq<Text>] text/format (coll [array] @@ -48,7 +48,7 @@ #let [last?-in (n/= (n/dec num-tags) tag-in)] value-in r.int] (test "Can translate variant." - (|> (run (` ((~ (code.nat tag-in)) (~ (code.bool last?-in)) (~ (code.int value-in))))) + (|> (run (` ((~ (code.nat tag-in)) (~ (code.bit last?-in)) (~ (code.int value-in))))) (case> (#e.Success valueT) (let [valueT (:coerce (Array Any) valueT)] (and (n/= +3 (array.size valueT)) |