mirror of
https://github.com/fmtlib/fmt.git
synced 2025-12-08 09:47:51 +08:00
15 lines
491 B
C++
15 lines
491 B
C++
#include <iostream>
|
|
#include "format.h"
|
|
|
|
int main() {
|
|
// Test short string formatting
|
|
std::string short_result = fmt::format_short("Hello, {}!", "World");
|
|
std::cout << "Short string test: " << short_result << std::endl;
|
|
|
|
// Test long string (trigger dynamic allocation)
|
|
std::string long_str(300, 'a');
|
|
std::string long_result = fmt::format_short("{}", long_str);
|
|
std::cout << "Long string test: " << (long_result == long_str ? "Success" : "Failed") << std::endl;
|
|
|
|
return 0;
|
|
} |