From a6127dd62ec56009d497271ba856f3b0012f229f Mon Sep 17 00:00:00 2001 From: marty1885 Date: Fri, 16 Jul 2021 14:29:45 +0800 Subject: [PATCH] fix wording of assertion types --- CHN-18-测试框架.md | 4 ++-- ENG-18-Testing-Framework.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHN-18-测试框架.md b/CHN-18-测试框架.md index 46be47c..491c087 100644 --- a/CHN-18-测试框架.md +++ b/CHN-18-测试框架.md @@ -73,7 +73,7 @@ DrogonTest 带有各种类型的测试和操作。 基本的 `CHECK()` 只检查 | 不做任何事 | CHECK | CHECK_THROWS | CHECK_NOTHROW | CHECK_THROWS_AS | | 返回 | REQUIRE | REQUIRE_THROWS | REQUIRE_NOTHROW | REQUIRE_THROWS_AS | | 自协程返回 | CO_REQUIRE | CO_REQUIRE_THROWS | CO_REQUIRE_NOTHROW | CO_REQUIRE_THROWS_AS | -| 杀死进程 | DEMAND | DEMAND_THROWS | DEMAND_NOTHROW | DEMAND_THROWS_AS | +| 杀死进程 | MANDATE | MANDATE_THROWS | MANDATE_NOTHROW | MANDATE_THROWS_AS | 让我们尝试一个稍微实际的例子。 假设我们正在测试文件的内容是否符合预期。 若程序无法打开文件则没有必要进一步检查。 因此,我们可以使用 REQUIRE 来缩短和减少重复代码。 @@ -91,7 +91,7 @@ DROGON_TEST(TestContent) } ``` -同样,`CO_REQUIRE` 就像 REQUIRE。 但是用于协程。 当操作修改且不可恢复的全局状态时,可以使用`DEMAND`。 唯一合乎逻辑的做法是停止测试。 +同样,`CO_REQUIRE` 就像 REQUIRE。 但是用于协程。 当操作修改且不可恢复的全局状态时,可以使用`MANDATE`。 唯一合乎逻辑的做法是停止测试。 ### 异步测试 diff --git a/ENG-18-Testing-Framework.md b/ENG-18-Testing-Framework.md index a722e85..c4938ab 100644 --- a/ENG-18-Testing-Framework.md +++ b/ENG-18-Testing-Framework.md @@ -73,7 +73,7 @@ DrogonTest comes with a variety of assertions and actions. The basic `CHECK()` s | nothing | CHECK | CHECK_THROWS | CHECK_NOTHROW | CHECK_THROWS_AS | | return | REQUIRE | REQUIRE_THROWS | REQUIRE_NOTHROW | REQUIRE_THROWS_AS | | co_return | CO_REQUIRE | CO_REQUIRE_THROWS | CO_REQUIRE_NOTHROW | CO_REQUIRE_THROWS_AS | -| kill process | DEMAND | DEMAND_THROWS | DEMAND_NOTHROW | DEMAND_THROWS_AS | +| kill process | MANDATE | MANDATE_THROWS | MANDATE_NOTHROW | MANDATE_THROWS_AS | Let's try a slightly practical example. Let's say you're testing if the content of a file is what you're expecting. There's no point to further test if the program failed to open the file. So, we can use `REQUIRE` to shorten and reduce duplicated code. @@ -91,7 +91,7 @@ DROGON_TEST(TestContent) } ``` -Likewise, `CO_REQUIRE` is like REQUIRE. But for coroutines. And `DEMAND` can be used when an operation failed and it modifies an unrecoverable global state. Which the only logical thing to do is to stop testing completely. +Likewise, `CO_REQUIRE` is like REQUIRE. But for coroutines. And `MANDATE` can be used when an operation failed and it modifies an unrecoverable global state. Which the only logical thing to do is to stop testing completely. ### Asynchronous testing