From 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:23:44 +1000 Subject: The Formatting String Catastrophe --- source/test/spawn_test.cpp | 2 +- source/test/string_test.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source/test') diff --git a/source/test/spawn_test.cpp b/source/test/spawn_test.cpp index 250dc22..202cc55 100644 --- a/source/test/spawn_test.cpp +++ b/source/test/spawn_test.cpp @@ -12,7 +12,7 @@ void validateWorld(TestUniverse& testUniverse) { // Just make sure the test world draws something for now, this will grow to // include more than this. - EXPECT_GE(testUniverse.currentClientDrawables().size(), 1u) << strf("world: %s", testUniverse.currentPlayerWorld()); + EXPECT_GE(testUniverse.currentClientDrawables().size(), 1u) << strf("world: {}", testUniverse.currentPlayerWorld()); auto assets = Root::singleton().assets(); for (auto const& drawable : testUniverse.currentClientDrawables()) { diff --git a/source/test/string_test.cpp b/source/test/string_test.cpp index ed01a4f..dcb2441 100644 --- a/source/test/string_test.cpp +++ b/source/test/string_test.cpp @@ -112,8 +112,8 @@ TEST(StringTest, contains) { } TEST(StringTest, format) { - EXPECT_EQ(strf("(%s, %s, %s)", 1, "foo", 3.2), "(1, foo, 3.2)"); - EXPECT_EQ(strf("%s (%s, %s, %s)", String("asdf\0", 5), 1, "foo", 3.2), String("asdf\0 (1, foo, 3.2)", 19)); + EXPECT_EQ(strf("({}, {}, {})", 1, "foo", 3.2), "(1, foo, 3.2)"); + EXPECT_EQ(strf("{} ({}, {}, {})", String("asdf\0", 5), 1, "foo", 3.2), String("asdf\0 (1, foo, 3.2)", 19)); } TEST(StringTest, append) { -- cgit v1.2.3