From 63b45e09c5f5ceb59a48ed05cdc2d2c6cb038a7b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 24 Dec 2021 08:58:01 -0400 Subject: Dusting off the pure-Lux JVM compiler machinery. --- stdlib/source/test/lux.lux | 151 ++++++++++++++++++++++----------------------- 1 file changed, 75 insertions(+), 76 deletions(-) (limited to 'stdlib/source/test/lux.lux') diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 7026c0a48..c200a0316 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -1,72 +1,71 @@ -(.with_expansions [' (.for ["{old}" (.as_is ["[1]/[0]" jvm]) - "JVM" (.as_is ["[1]/[0]" jvm])] - (.as_is)) - '] - (.using - [library - ["/" lux "*" - [program {"+" program:}] - ["_" test {"+" Test}] - ["@" target] - [abstract - [monad {"+" do}]] - [control - ["[0]" io] - ["[0]" maybe ("[1]#[0]" functor)] - [concurrency - ["[0]" atom {"+" Atom}]] - [parser - ["<[0]>" code]]] - [data - ["[0]" product] - ["[0]" bit ("[1]#[0]" equivalence)] - ["[0]" text ("[1]#[0]" equivalence) - ["%" format {"+" format}]] - [collection - ["[0]" list ("[1]#[0]" functor)] - ["[0]" set {"+" Set} ("[1]#[0]" equivalence)] - [dictionary - ["[0]" plist]]]] - ["[0]" macro - [syntax {"+" syntax:}] - ["[0]" code ("[1]#[0]" equivalence)] - ["[0]" template]] - ["[0]" math - ["[0]" random ("[1]#[0]" functor)] - [number - [i8 {"+"}] - [i16 {"+"}] - ["n" nat] - ["i" int] - ["r" rev] - ["f" frac] - ["[0]" i64]]] - ["[0]" meta - ["[0]" location ("[1]#[0]" equivalence)]]]] - ... TODO: Must have 100% coverage on tests. - ["[0]" / "_" - ["[1][0]" abstract] - ["[1][0]" control] - ["[1][0]" data] - ["[1][0]" debug] - ["[1][0]" documentation] - ["[1][0]" locale] - ["[1][0]" macro - ["[1]/[0]" code]] - ["[1][0]" math] - ["[1][0]" meta] - ["[1][0]" program] - ["[1][0]" static] - ["[1][0]" target] - ["[1][0]" test] - ["[1][0]" time] - ... ["[1][0]" tool] ... TODO: Update & expand tests for this - ["[1][0]" type] - ["[1][0]" world] - ["[1][0]" ffi] - ["[1][0]" extension] - ["[1][0]" target "_" - ]])) +(.`` (.`` (.using + [library + ["/" lux "*" + [program {"+" program:}] + ["_" test {"+" Test}] + ["@" target] + [abstract + [monad {"+" do}]] + [control + ["[0]" io] + ["[0]" maybe ("[1]#[0]" functor)] + [concurrency + ["[0]" atom {"+" Atom}]] + [parser + ["<[0]>" code]]] + [data + ["[0]" product] + ["[0]" bit ("[1]#[0]" equivalence)] + ["[0]" text ("[1]#[0]" equivalence) + ["%" format {"+" format}]] + [collection + ["[0]" list ("[1]#[0]" functor)] + ["[0]" set {"+" Set} ("[1]#[0]" equivalence)] + [dictionary + ["[0]" plist]]]] + ["[0]" macro + [syntax {"+" syntax:}] + ["[0]" code ("[1]#[0]" equivalence)] + ["[0]" template]] + ["[0]" math + ["[0]" random ("[1]#[0]" functor)] + [number + [i8 {"+"}] + [i16 {"+"}] + ["n" nat] + ["i" int] + ["r" rev] + ["f" frac] + ["[0]" i64]]] + ["[0]" meta + ["[0]" location ("[1]#[0]" equivalence)]]]] + ... TODO: Must have 100% coverage on tests. + ["[0]" / "_" + ["[1][0]" abstract] + ["[1][0]" control] + ["[1][0]" data] + ["[1][0]" debug] + ["[1][0]" documentation] + ["[1][0]" locale] + ["[1][0]" macro + ["[1]/[0]" code]] + ["[1][0]" math] + ["[1][0]" meta] + ["[1][0]" program] + ["[1][0]" static] + ["[1][0]" target] + ["[1][0]" test] + ["[1][0]" time] + ... ["[1][0]" tool] ... TODO: Update & expand tests for this + ["[1][0]" type] + ["[1][0]" world] + ["[1][0]" ffi] + ["[1][0]" extension] + ["[1][0]" target "_" + (~~ (.for ["{old}" (~~ (.as_is ["[1]/[0]" jvm])) + "JVM" (~~ (.as_is ["[1]/[0]" jvm])) + "JavaScript" (~~ (.as_is ["[1]/[0]" js]))] + (~~ (.as_is))))]]))) ... TODO: Get rid of this ASAP (template: (!bundle body) @@ -79,7 +78,8 @@ Test (with_expansions [... TODO: Update & expand tests for this (for [@.jvm (~~ (as_is /target/jvm.test)) - @.old (~~ (as_is /target/jvm.test))] + @.old (~~ (as_is /target/jvm.test)) + @.js (~~ (as_is /target/js.test))] (~~ (as_is))) (for [@.old (~~ (as_is))] (~~ (as_is /extension.test)))] @@ -865,12 +865,11 @@ (hide left)) true))))) (_.cover [/.same?] - (let [not_left (|> left ++ -- %.nat) - left (%.nat left)] - (and (and (/.same? left left) - (/.same? not_left not_left)) - (and (text#= left not_left) - (not (/.same? left not_left)))))) + (let [not_left (atom.atom left) + left (atom.atom left)] + (and (/.same? left left) + (/.same? not_left not_left) + (not (/.same? left not_left))))) (_.cover [/.Rec] (let [list (: (/.Rec NList (Maybe [Nat NList])) -- cgit v1.2.3