diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-04-22 13:19:46 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-04-22 13:19:46 +0100 |
| commit | f6c7948c12455c55f19ac27f328478b486f8098e (patch) | |
| tree | 204e1d60e1486031a5818e7738b73d070ef853b6 /src/unit_tests.cc | |
| parent | 8ff63198bca86e00d8572d27d04321a3aefa5f73 (diff) | |
Add format_to allowing formating to an existing buffer
Diffstat (limited to 'src/unit_tests.cc')
| -rw-r--r-- | src/unit_tests.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/unit_tests.cc b/src/unit_tests.cc index 5c43c848..58f34a98 100644 --- a/src/unit_tests.cc +++ b/src/unit_tests.cc @@ -140,6 +140,9 @@ void test_string() kak_assert(format("Youhou {1} {} {0} \\{}", 10, "hehe", 5) == "Youhou hehe 5 10 {}"); + char buffer[20]; + kak_assert(format_to(buffer, "Hey {}", 15) == "Hey 15"); + kak_assert(str_to_int("5") == 5); kak_assert(str_to_int(to_string(INT_MAX)) == INT_MAX); kak_assert(str_to_int(to_string(INT_MIN)) == INT_MIN); |
