зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1892649 - Add some tests to cover nsPrintfCString width specifier. r=xpcom-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208091
This commit is contained in:
Родитель
40927b0179
Коммит
f0f0f627fe
|
@ -2262,6 +2262,30 @@ TEST_F(Strings, printf) {
|
|||
create_printf_strings(format, (char*)anotherString);
|
||||
verify_printf_strings(expectedOutput);
|
||||
}
|
||||
{
|
||||
const char* format = "RightJustify %8s";
|
||||
const char* expectedOutput = "RightJustify foo";
|
||||
create_printf_strings(format, "foo");
|
||||
verify_printf_strings(expectedOutput);
|
||||
}
|
||||
{
|
||||
const char* format = "LeftJustify %-8s";
|
||||
const char* expectedOutput = "LeftJustify foo ";
|
||||
create_printf_strings(format, "foo");
|
||||
verify_printf_strings(expectedOutput);
|
||||
}
|
||||
{
|
||||
const char* format = "RightJustify2 %*s";
|
||||
const char* expectedOutput = "RightJustify2 foo";
|
||||
create_printf_strings(format, 8, "foo");
|
||||
verify_printf_strings(expectedOutput);
|
||||
}
|
||||
{
|
||||
const char* format = "LeftJustify2 %-*s";
|
||||
const char* expectedOutput = "LeftJustify2 foo ";
|
||||
create_printf_strings(format, 8, "foo");
|
||||
verify_printf_strings(expectedOutput);
|
||||
}
|
||||
}
|
||||
|
||||
// We don't need these macros following the printf test.
|
||||
|
|
Загрузка…
Ссылка в новой задаче