aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.cli/test.cc
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-07-01 19:18:42 +0100
committerLexi Winter <lexi@le-fay.org>2025-07-01 19:18:42 +0100
commit378dd663a402fe196f2b56c6413eb3f623aecbbf (patch)
tree6d13f14ff8f9bff7c55a30eb046af489d0f677a2 /nihil.cli/test.cc
parent2e2d1bd3b6c7776b77c33b94f30ead89367a71e6 (diff)
downloadnihil-378dd663a402fe196f2b56c6413eb3f623aecbbf.tar.gz
nihil-378dd663a402fe196f2b56c6413eb3f623aecbbf.tar.bz2
cli: refactoring
Diffstat (limited to 'nihil.cli/test.cc')
-rw-r--r--nihil.cli/test.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/nihil.cli/test.cc b/nihil.cli/test.cc
index 61d164d..8253bdc 100644
--- a/nihil.cli/test.cc
+++ b/nihil.cli/test.cc
@@ -1,5 +1,7 @@
// This source code is released into the public domain.
+#include <sysexits.h>
+
#include <catch2/catch_test_macros.hpp>
import nihil.std;
@@ -69,7 +71,7 @@ TEST_CASE("nihil.cli: dispatch_command: unknown command", "[nihil.cli]")
output = capture.str();
}
- REQUIRE(ret == 1);
+ REQUIRE(ret == EX_USAGE);
auto const *progname = ::getprogname();
REQUIRE(output == std::format("{}: usage:\n cmd\n", progname));
@@ -92,7 +94,7 @@ TEST_CASE("nihil.cli: dispatch_command: incomplete command", "[nihil.cli]")
output = capture.str();
}
- REQUIRE(ret == 1);
+ REQUIRE(ret == EX_USAGE);
auto const *progname = ::getprogname();
REQUIRE(output == std::format("{}: usage:\n cmd sub1\n cmd sub2\n",