mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-23 16:06:53 +00:00
10dcd1f847
It does the same as before. I think performance is not a concern here, and wasn't my motivation either. But I hope this makes the code easier to read and to reason with. I added a pure unit test case (without involving an actual Language object) to cover the previously uncovered digits feature. Change-Id: I6a0fc86035817eabb42b55e58183ae094c052aa6
31 lines
788 B
JSON
31 lines
788 B
JSON
[
|
|
{
|
|
"format": "Y n j D H i",
|
|
"digits": null,
|
|
"data": [ null, "2011", "2", "3", "unused", "04", "05", "UTC" ],
|
|
"expected": "2011-02-03T04:05:00+00:00",
|
|
"message": "Date is parsed"
|
|
},
|
|
{
|
|
"format": "xkY xg d \"asdf\" G i",
|
|
"digits": null,
|
|
"data": [ null, "2554", "February", "03", "4", "05", "UTC" ],
|
|
"expected": "2011-02-03T04:05:00+00:00",
|
|
"message": "Date is parsed"
|
|
},
|
|
{
|
|
"format": "H i n j Y",
|
|
"digits": null,
|
|
"data": [ null, "04", "05", "2", "3", "2011", "UTC" ],
|
|
"expected": "2011-02-03T04:05:00+00:00",
|
|
"message": "Date is parsed"
|
|
},
|
|
{
|
|
"format": "Y-m-d",
|
|
"digits": [ "⁰", "¹", "²" ],
|
|
"data": [ null, "²⁰²¹", "¹²", "⁰¹", "UTC" ],
|
|
"expected": "2021-12-01T00:00:00+00:00",
|
|
"message": "Localized digits are un-transformed"
|
|
}
|
|
]
|