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

Function TestWrapLargeStringInput

test/safe_arithmetic.cxx:244–262  ·  view source on GitHub ↗

Test Wrap function with large string input

Source from the content-addressed store, hash-verified

242
243// Test Wrap function with large string input
244void TestWrapLargeStringInput()
245{
246 // Test with very long string that could trigger width calculation issues
247 std::string long_string(1000, 'a');
248
249 auto result = args::Wrap(long_string, 80);
250 test::require(!result.empty());
251 std::cout << "PASS: Wrap long string (1000 chars) with width 80" << std::endl;
252
253 // Test with extremely large width
254 result = args::Wrap(long_string, std::numeric_limits<size_t>::max());
255 test::require(result.size() >= 1);
256 std::cout << "PASS: Wrap long string with SIZE_MAX width" << std::endl;
257
258 // Test with width of 1
259 result = args::Wrap(long_string, 1);
260 test::require(!result.empty());
261 std::cout << "PASS: Wrap long string with width 1" << std::endl;
262}
263
264// Main test runner
265int main()

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected