From 2e2d1bd3b6c7776b77c33b94f30ead89367a71e6 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Tue, 1 Jul 2025 17:07:04 +0100 Subject: add nihil.std --- nihil.cli/test.cc | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'nihil.cli/test.cc') diff --git a/nihil.cli/test.cc b/nihil.cli/test.cc index c82281e..61d164d 100644 --- a/nihil.cli/test.cc +++ b/nihil.cli/test.cc @@ -1,12 +1,8 @@ -/* - * This source code is released into the public domain. - */ - -#include -#include +// This source code is released into the public domain. #include +import nihil.std; import nihil.cli; import nihil.util; @@ -34,9 +30,9 @@ TEST_CASE("nihil.cli: dispatch_command: basic", "[nihil.cli]") auto args = std::vector{ "cmd", "sub1", nullptr }; - auto argv = const_cast(args.data()); + auto *argv = const_cast(args.data()); - int ret = nihil::dispatch_command( + auto const ret = nihil::dispatch_command( static_cast(args.size()) - 1, argv); REQUIRE(ret == 0); REQUIRE(cmd_sub1_called == true); @@ -47,9 +43,9 @@ TEST_CASE("nihil.cli: dispatch_command: basic", "[nihil.cli]") auto args = std::vector{ "cmd", "sub2", nullptr }; - auto argv = const_cast(args.data()); + auto *argv = const_cast(args.data()); - int ret = nihil::dispatch_command( + auto const ret = nihil::dispatch_command( static_cast(args.size()) - 1, argv); REQUIRE(ret == 0); REQUIRE(cmd_sub2_called == true); @@ -61,7 +57,7 @@ TEST_CASE("nihil.cli: dispatch_command: unknown command", "[nihil.cli]") auto args = std::vector{ "nocomd", "sub", nullptr }; - auto argv = const_cast(args.data()); + auto *argv = const_cast(args.data()); auto output = std::string(); auto ret = int{}; @@ -75,7 +71,7 @@ TEST_CASE("nihil.cli: dispatch_command: unknown command", "[nihil.cli]") REQUIRE(ret == 1); - auto *progname = ::getprogname(); + auto const *progname = ::getprogname(); REQUIRE(output == std::format("{}: usage:\n cmd\n", progname)); } @@ -84,7 +80,7 @@ TEST_CASE("nihil.cli: dispatch_command: incomplete command", "[nihil.cli]") auto args = std::vector{ "cmd", nullptr }; - auto argv = const_cast(args.data()); + auto *argv = const_cast(args.data()); auto output = std::string(); auto ret = int{}; @@ -98,7 +94,7 @@ TEST_CASE("nihil.cli: dispatch_command: incomplete command", "[nihil.cli]") REQUIRE(ret == 1); - auto *progname = ::getprogname(); + auto const *progname = ::getprogname(); REQUIRE(output == std::format("{}: usage:\n cmd sub1\n cmd sub2\n", progname)); } -- cgit v1.2.3