| 54 | // output via string_formatter (not used on raw printf). |
| 55 | template<typename ...Args> |
| 56 | void 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. |
| 73 | template<typename T> |
| 74 | void test_lvalues( const std::string &expected, const char *const pattern, const T &value ) |
no test coverage detected