diff options
author | Eduardo Julian | 2022-11-16 23:17:45 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-11-16 23:17:45 -0400 |
commit | 4ea7563c46a07dbe1cb84547a60e9398144917ae (patch) | |
tree | 1ec4f761600dba9c415d437ecc7b9dba1d3bd57f /stdlib/source/library/lux/test | |
parent | 91a1f21f3c75750217d272554bc8a341f075f82d (diff) |
Added generic logging abstraction/machinery.
Diffstat (limited to 'stdlib/source/library/lux/test')
-rw-r--r-- | stdlib/source/library/lux/test/unit.lux | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/stdlib/source/library/lux/test/unit.lux b/stdlib/source/library/lux/test/unit.lux index 86df9efd0..e8eeb0a04 100644 --- a/stdlib/source/library/lux/test/unit.lux +++ b/stdlib/source/library/lux/test/unit.lux @@ -10,6 +10,8 @@ [concurrency ["[0]" async (.only Async) (.use "[1]#[0]" monad)]]] [data + [color + ["[0]" terminal]] ["[0]" text (.only) ["%" \\format (.only format)]] [collection @@ -60,10 +62,13 @@ (-> Text Test Test) (|>> %.text context')) -(with_template [<prefix> <tally> <raw> <quoted>] +(with_template [<prefix> <tally> <raw> <quoted> <foreground>] [(def <raw> (-> Text Test) - (|>> (format <prefix>) + (|>> (format "[" + (terminal.with <foreground> + <prefix>) + "] ") [<tally>] async#in)) @@ -71,8 +76,8 @@ (-> Text Test) (|>> %.text <raw>))] - ["[Failure] " tally.failure failure' failure] - ["[Success] " tally.success success' success] + ["Failure" tally.failure failure' failure terminal.red_foreground] + ["Success" tally.success success' success terminal.green_foreground] ) (def (test' message condition) |