From 52806bc618b7eee43bb1aa1300247c92e05b7ab1 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 17 Aug 2022 13:26:39 -0400 Subject: Made the compiler's caching system sensitive to the build configuration. --- stdlib/source/test/lux.lux | 22 +++++++++++----------- stdlib/source/test/lux/control/try.lux | 12 ++++++++++++ .../source/test/lux/meta/compiler/meta/archive.lux | 13 ++++++++----- .../test/lux/meta/compiler/meta/cache/archive.lux | 9 ++++++--- 4 files changed, 37 insertions(+), 19 deletions(-) (limited to 'stdlib/source/test') diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 53d699818..03ec5b64f 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -1196,21 +1196,21 @@ (_.in_parallel (list ..test|lux - /abstract.test - /control.test - /data.test - /debug.test + ... /abstract.test + ... /control.test + ... /data.test + ... /debug.test - /documentation.test - /math.test + ... /documentation.test + ... /math.test - /meta.test - /program.test - /test/property.test + ... /meta.test + ... /program.test + ... /test/property.test - /world.test + ... /world.test - /ffi.test + ... /ffi.test )))) (def _ diff --git a/stdlib/source/test/lux/control/try.lux b/stdlib/source/test/lux/control/try.lux index 00aac612f..ff8fe9455 100644 --- a/stdlib/source/test/lux/control/try.lux +++ b/stdlib/source/test/lux/control/try.lux @@ -80,6 +80,18 @@ (/.else alternative {/.#Success expected})) (n.= alternative (/.else alternative (is (Try Nat) {/.#Failure error}))))) + (_.coverage [/.when] + (`` (and (,, (with_template [] + [(at (/.equivalence n.equivalence) = + + (/.when true ))] + + [{/.#Success expected}] + [{/.#Failure error}] + )) + (at (/.equivalence n.equivalence) = + (/.when false {/.#Success expected}) + (/.when false {/.#Failure error}))))) (_.coverage [/.with /.lifted] (let [lifted (/.lifted io.monad)] (|> (do (/.with io.monad) diff --git a/stdlib/source/test/lux/meta/compiler/meta/archive.lux b/stdlib/source/test/lux/meta/compiler/meta/archive.lux index 0f1db62b4..44b3961ea 100644 --- a/stdlib/source/test/lux/meta/compiler/meta/archive.lux +++ b/stdlib/source/test/lux/meta/compiler/meta/archive.lux @@ -34,7 +34,9 @@ ["[1][0]" artifact] ["[1][0]" registry] ["[1][0]" module] - ["[1][0]" unit]]) + ["[1][0]" unit] + [//// + ["[1][0]" configuration]]]) (def .public (descriptor module hash) (-> /descriptor.Module Nat /descriptor.Descriptor) @@ -55,6 +57,7 @@ content/0 random.nat content/1 (random.only (|>> (n.= content/0) not) random.nat) hash random.nat + configuration ($/configuration.random 1) .let [key (/key.key signature content/0)]] (all _.and (_.coverage [/.has /.find] @@ -177,8 +180,8 @@ archive (/.has module/1 entry/1 archive) .let [pre (/.reserved archive)] archive (|> archive - (/.export version) - (/.import version)) + (/.export version configuration) + (/.import version configuration)) .let [post (/.reserved archive)]] (in (set#= (set.of_list text.hash pre) (set.of_list text.hash post)))) @@ -186,8 +189,8 @@ (_.coverage [/.version_mismatch] (|> (do try.monad [archive (|> /.empty - (/.export version) - (/.import fake_version))] + (/.export version configuration) + (/.import fake_version configuration))] (in false)) (exception.otherwise (exception.match? /.version_mismatch)))) ))) diff --git a/stdlib/source/test/lux/meta/compiler/meta/cache/archive.lux b/stdlib/source/test/lux/meta/compiler/meta/cache/archive.lux index 2ba4c9af8..9e80f0c14 100644 --- a/stdlib/source/test/lux/meta/compiler/meta/cache/archive.lux +++ b/stdlib/source/test/lux/meta/compiler/meta/cache/archive.lux @@ -34,7 +34,9 @@ [// ["[1][0]" context] ["[1][0]" archive (.only) - ["[2][0]" signature]]]]) + ["[2][0]" signature]] + [/// + ["[1][0]" configuration]]]]) (def .public test Test @@ -49,6 +51,7 @@ content/1 (random.only (|>> (n.= content/0) not) random.nat) hash random.nat signature $signature.random + configuration ($configuration.random 1) .let [key (key.key signature content/0) [archive expected] (|> (do try.monad [[@module/0 archive] (archive.reserve module/0 archive.empty) @@ -65,13 +68,13 @@ archive.#registry registry.empty]] archive (archive.has module/0 entry/0 archive) archive (archive.has module/1 entry/1 archive)] - (in [archive (archive.export ///.version archive)])) + (in [archive (archive.export ///.version configuration archive)])) try.trusted)]] (all _.and (in (do [! async.monad] [pre/0 (at fs file? (/.descriptor fs context)) enabled? (//.enable! ! fs context) - cached? (/.cache! fs context archive) + cached? (/.cache! fs configuration context archive) actual (at fs read (/.descriptor fs context)) post/0 (at fs file? (/.descriptor fs context))] (unit.coverage [/.descriptor /.cache!] -- cgit v1.2.3