mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-19 00:46:03 +01:00
std::string double percent Format bug fix
This commit is contained in:
parent
cf20ff1bd7
commit
d740264009
@ -356,8 +356,8 @@ void format(std::string& result, const std::string& fmt, const std::vector<Any>&
|
||||
++itFmt;
|
||||
if (itFmt != endFmt && itVal != endVal)
|
||||
formatOne(result, itFmt, endFmt, itVal);
|
||||
else
|
||||
result += *itFmt;
|
||||
else if (itFmt != endFmt)
|
||||
result += *itFmt++;
|
||||
break;
|
||||
default:
|
||||
result += *itFmt;
|
||||
|
@ -318,6 +318,12 @@ void FormatTest::testString()
|
||||
|
||||
s = format("%-5s", foo);
|
||||
assert (s == "foo ");
|
||||
|
||||
s = format("%s%%a", foo);
|
||||
assert (s == "foo%a");
|
||||
|
||||
s = format("'%s%%''%s%%'", foo, foo);
|
||||
assert (s == "'foo%''foo%'");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user