Add more wxString::Format() positional parameters tests.

Verify that repeating positional parameters does work with wxString::Format()
instead of keeping these tests commented out in wxVsnprintf() tests, which are
not run at all if we're using the compiler-provided vsprintf().

Closes #9367.
This commit is contained in:
Vadim Zeitlin
2015-05-28 14:12:48 +02:00
parent 01cf62684c
commit ee973e1fe7
2 changed files with 13 additions and 13 deletions

View File

@@ -168,11 +168,24 @@ void StringTestCase::Format()
}
// Positional parameters tests:
CPPUNIT_ASSERT_EQUAL
(
"two one",
wxString::Format(wxT("%2$s %1$s"), wxT("one"), wxT("two"))
);
CPPUNIT_ASSERT_EQUAL
(
"hello hello",
wxString::Format("%1$s %1$s", "hello")
);
CPPUNIT_ASSERT_EQUAL
(
"4 world hello world 3",
wxString::Format("%4$d %2$s %1$s %2$s %3$d", "hello", "world", 3, 4)
);
}
void StringTestCase::FormatUnicode()