MCPcopy Create free account
hub / github.com/CleverRaven/Cataclysm-DDA / test_new_old_pattern

Function test_new_old_pattern

tests/string_formatter_test.cpp:56–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54// output via string_formatter (not used on raw printf).
55template<typename ...Args>
56void test_new_old_pattern( const char *const old_pattern, const char *const new_pattern,
57 Args &&...args )
58{
59 CAPTURE( old_pattern );
60 CAPTURE( new_pattern );
61
62 std::string original_result = cata::string_formatter::raw_string_format( old_pattern,
63 std::forward<Args>( args )... );
64 std::string old_result = throwing_string_format( old_pattern, std::forward<Args>( args )... );
65 CHECK( original_result == old_result );
66
67 if( new_pattern ) {
68 std::string new_result = throwing_string_format( new_pattern, std::forward<Args>( args )... );
69 CHECK( original_result == new_result );
70 }
71}
72// Test that supplying `T&&`, `T&` and `const T&` as arguments will work the same.
73template<typename T>
74void test_lvalues( const std::string &expected, const char *const pattern, const T &value )

Callers 2

test_typed_printfFunction · 0.85

Calls 1

throwing_string_formatFunction · 0.85

Tested by

no test coverage detected