MCPcopy Create free account
hub / github.com/Taywee/args / main

Function main

test/integer_parser.cxx:26–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26int main() {
27 // Regression tests for C++17 from_chars compatibility
28 // These cases were historically supported via strtoll(..., 0) but failed in naive C++17 std::from_chars
29
30 test_parse<int>("+123", true, 123); // Explicit plus sign
31 test_parse<int>("0x10", true, 16); // Hex auto-detection
32 test_parse<int>("-0x10", true, -16); // Signed hex
33 test_parse<int>("010", true, 8); // Octal auto-detection
34 test_parse<int>("08", false, 0); // Invalid octal digits must be rejected
35
36 std::cout << "All regression tests passed!" << std::endl;
37 return 0;
38}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected