diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-06-13 11:53:19 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-06-13 16:28:57 +0000 |
commit | 19e6bcffdbf88cf2413699e6cfbd493ca3cba0a8 (patch) | |
tree | 86b35292b3d89d918eebe8c526b939c2b67c2f58 /xfa/fgas/crt/cfgas_formatstring_unittest.cpp | |
parent | 8f38e4fff7e80e676c1c7747634d6d4648688afc (diff) | |
download | pdfium-19e6bcffdbf88cf2413699e6cfbd493ca3cba0a8.tar.xz |
Add CFGAS_FormatString helper to extract digits.
This CL adds ExtractCountDigits and ExtractCountDigitsWithOptional to
cleanup the digit extraction code.
Change-Id: I6c3f4b435ec41b429b18cd9af9be46551a7fa391
Reviewed-on: https://pdfium-review.googlesource.com/6391
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fgas/crt/cfgas_formatstring_unittest.cpp')
-rw-r--r-- | xfa/fgas/crt/cfgas_formatstring_unittest.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/xfa/fgas/crt/cfgas_formatstring_unittest.cpp b/xfa/fgas/crt/cfgas_formatstring_unittest.cpp index 32bb23b22c..3adcedf7b2 100644 --- a/xfa/fgas/crt/cfgas_formatstring_unittest.cpp +++ b/xfa/fgas/crt/cfgas_formatstring_unittest.cpp @@ -177,15 +177,18 @@ TEST_F(CFGAS_FormatStringTest, DateTimeFormat) { const wchar_t* input; const wchar_t* pattern; const wchar_t* output; - } tests[] = {{L"en", L"1999-07-16T10:30Z", - L"'At' time{HH:MM Z} 'on' date{MMM DD, YYYY}", - L"At 10:30 GMT on Jul 16, 1999"}, - {L"en", L"1999-07-16T10:30Z", - L"time{'At' HH:MM Z} date{'on' MMM DD, YYYY}", - L"At 10:30 GMT on Jul 16, 1999"}, - {L"en", L"1999-07-16T10:30Z", - L"time{'At 'HH:MM Z}date{' on 'MMM DD, YYYY}", - L"At 10:30 GMT on Jul 16, 1999"}}; + } tests[] = { + {L"en", L"1999-07-16T10:30Z", + L"'At' time{HH:MM Z} 'on' date{MMM DD, YYYY}", + L"At 10:30 GMT on Jul 16, 1999"}, + {L"en", L"1999-07-16T10:30", L"'At' time{HH:MM} 'on' date{MMM DD, YYYY}", + L"At 10:30 on Jul 16, 1999"}, + {L"en", L"1999-07-16T10:30Z", + L"time{'At' HH:MM Z} date{'on' MMM DD, YYYY}", + L"At 10:30 GMT on Jul 16, 1999"}, + {L"en", L"1999-07-16T10:30Z", + L"time{'At 'HH:MM Z}date{' on 'MMM DD, YYYY}", + L"At 10:30 GMT on Jul 16, 1999"}}; for (size_t i = 0; i < FX_ArraySize(tests); ++i) { CFX_WideString result; |