diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-11-26 20:44:52 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-11-26 20:44:52 -0800 |
commit | 6515192306e1c37cea8ec1dddee3556fba44a5d6 (patch) | |
tree | add4ac3b5f529610952e75c4f98d870809f5d95b /029tools.cc | |
parent | eb2b6cd21e06b3a421ede3f7a6ae78b932dcab19 (diff) | |
download | mu-6515192306e1c37cea8ec1dddee3556fba44a5d6.tar.gz |
3694
Fix CI, broken by commit 3691.
Diffstat (limited to '029tools.cc')
-rw-r--r-- | 029tools.cc | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/029tools.cc b/029tools.cc index 67c58154..474bdc62 100644 --- a/029tools.cc +++ b/029tools.cc @@ -187,43 +187,6 @@ case _SAVE_TRACE: { break; } -//: assert: perform sanity checks at runtime - -:(scenario assert) -% Hide_errors = true; // '%' lines insert arbitrary C code into tests before calling 'run' with the lines below. Must be immediately after :(scenario) line. -def main [ - assert 0, [this is an assert in Mu] -] -+error: this is an assert in Mu - -:(before "End Primitive Recipe Declarations") -ASSERT, -:(before "End Primitive Recipe Numbers") -put(Recipe_ordinal, "assert", ASSERT); -:(before "End Primitive Recipe Checks") -case ASSERT: { - if (SIZE(inst.ingredients) != 2) { - raise << maybe(get(Recipe, r).name) << "'assert' takes exactly two ingredients rather than '" << inst.original_string << "'\n" << end(); - break; - } - if (!is_mu_scalar(inst.ingredients.at(0))) { - raise << maybe(get(Recipe, r).name) << "'assert' requires a boolean for its first ingredient, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); - break; - } - if (!is_mu_text(inst.ingredients.at(1))) { - raise << maybe(get(Recipe, r).name) << "'assert' requires a text as its second ingredient, but got '" << inst.ingredients.at(1).original_string << "'\n" << end(); - break; - } - break; -} -:(before "End Primitive Recipe Implementations") -case ASSERT: { - if (!ingredients.at(0).at(0)) { - raise << read_mu_text(ingredients.at(1).at(0)) << '\n' << end(); - } - break; -} - //:: 'cheating' by using the host system :(before "End Primitive Recipe Declarations") |