From dc7e503342ab8b32ee21bb44ea5b4c26d9b0dba4 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 13 May 2023 12:50:10 +0200 Subject: [PATCH] tests: Test character formatting --- tests/libluna/TestFormat.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/libluna/TestFormat.cpp b/tests/libluna/TestFormat.cpp index 955d342c..587c87f3 100644 --- a/tests/libluna/TestFormat.cpp +++ b/tests/libluna/TestFormat.cpp @@ -280,6 +280,15 @@ TestResult test_verbatim_percent_format() test_success; } +TestResult test_format_character() +{ + auto fmt = TRY(String::format("exampl%c"_sv, 'e')); + + validate(fmt.view() == "example"); + + test_success; +} + Result test_main() { test_prelude; @@ -315,6 +324,7 @@ Result test_main() run_test(test_negative_va_width); run_test(test_negative_va_precision); run_test(test_verbatim_percent_format); + run_test(test_format_character); return {}; }