Use std::optional

This commit is contained in:
Chris Thrasher
2025-09-21 16:55:09 -06:00
parent db46dc4cb2
commit a5735af2f7
26 changed files with 74 additions and 264 deletions

View File

@@ -12,14 +12,13 @@
TEST_CASE("Parse uints", "[parse-numbers]") {
using Catch::parseUInt;
using Catch::Optional;
SECTION("proper inputs") {
REQUIRE( parseUInt( "0" ) == Optional<unsigned int>{ 0 } );
REQUIRE( parseUInt( "100" ) == Optional<unsigned int>{ 100 } );
REQUIRE( parseUInt( "0" ) == std::optional<unsigned int>{ 0 } );
REQUIRE( parseUInt( "100" ) == std::optional<unsigned int>{ 100 } );
REQUIRE( parseUInt( "4294967295" ) ==
Optional<unsigned int>{ 4294967295 } );
REQUIRE( parseUInt( "0xFF", 16 ) == Optional<unsigned int>{ 255 } );
std::optional<unsigned int>{ 4294967295 } );
REQUIRE( parseUInt( "0xFF", 16 ) == std::optional<unsigned int>{ 255 } );
}
SECTION( "Bad inputs" ) {
// empty