From 378dd663a402fe196f2b56c6413eb3f623aecbbf Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Tue, 1 Jul 2025 19:18:42 +0100 Subject: cli: refactoring --- nihil.cli/test.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nihil.cli/test.cc') 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 + #include 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", -- cgit v1.2.3