From 2fcf1b51715a15bea2de646a51428f4020463abd Mon Sep 17 00:00:00 2001 From: trcrsired Date: Mon, 30 Sep 2024 05:47:56 -0400 Subject: [PATCH] add resize_and_overwrite test --- tests/0026.container/0004.string/string.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/0026.container/0004.string/string.cc b/tests/0026.container/0004.string/string.cc index c794bb791..d757dcef3 100644 --- a/tests/0026.container/0004.string/string.cc +++ b/tests/0026.container/0004.string/string.cc @@ -1,5 +1,6 @@ #include #include +#include int main() { @@ -42,6 +43,10 @@ int main() ::std::ranges::swap(str19,str18); auto str20(str16); str20.erase_index(1,3); + str20.resize_and_overwrite(40,[](char8_t* buf, ::std::size_t n) noexcept + { + return static_cast<::std::size_t>(::std::fill_n(buf, 20u, u8'z') - buf); + }); ::fast_io::io::println( ::fast_io::u8c_stdout(), u8"u8vw=", u8vw,