Commit graph

7 commits

Author SHA1 Message Date
Bartosz Dziewoński f934e9aefd Add integration tests using pages from sr.wp
For testing our handling of language variants.

Bug: T259818
Change-Id: Id25b537fecd789640c209ff7f30e777455a3aece
2020-09-16 22:07:16 +00:00
Bartosz Dziewoński 329df8c953 Parsing discussions converted to language variants
* Export parser data (date format, digits, timezone names, and
  messages for weekday/month names) converted to language variants
* Update the parsers to try matching using every variant, in case
  the page is displayed in non-default variant (and to avoid
  problems with incomplete variant conversion)

Bug: T259818
Change-Id: I04d73992cd31ce06fa79f87df0c0a53d7efc3c58
2020-09-16 22:07:07 +00:00
Bartosz Dziewoński 934872a170 Add integration tests using pages from ckb.wp
This is primarily to cover the handling of localised digits,
which previously wasn't being tested, leading to T261706.

Bug: T261706
Change-Id: I9de7f01f77e767e9048c85604b559af4bca0de91
2020-09-01 01:50:33 +02:00
Bartosz Dziewoński 084f45128c Improve and document the files in tests/data/
* Remove 'wgMetaNamespace' and 'wgMetaNamespaceTalk', the same data
  exists in 'wgFormattedNamespaces'.

* Rename 'wgContentLang' to 'wgContentLanguage', to match its real
  name in JS config. MediaWiki doesn't use 'wgContentLang' anywhere,
  although the related PHP global is called $wgContLang.

* Document how I made these files, previously only mentioned in the
  commit message of e9c401e3aa.

Change-Id: I67f962812c155aedf41154e0d837e7feb5af972d
2020-09-01 01:50:33 +02:00
Bartosz Dziewoński 2d3fe47ac1 Fix parsing localised digits in PHP discussion parser
The PHP code incorrectly assumed that the digits are single-byte in
UTF-8, which is never the case (except for 0-9).

The JS code worked correctly because it uses UTF-16 strings, so the
bug would only affect non-BMP digits there. This was noted in a TODO
comment, but we overlooked it when reimplementing in PHP.

Instead of a string of 10 characters, use an array of 10
single-character strings.

Bug: T261706
Change-Id: Ic5421382474c88f003424799c53ff473d99cce92
2020-09-01 01:50:33 +02:00
Bartosz Dziewoński 43a7e82ed0 Tests covering fr.wp unsigned comment templates
Bug: T252058
Bug: T252059
Change-Id: Ica7426055e73562a98b99d6ea06e257df77b7493
2020-05-28 00:13:07 +02:00
Ed Sanders c5d1029b25 Move /cases and /data up to /tests
Theses are no longer QUnit specific.

Change-Id: I5f3cca1ff686922e0cdaaedb80858f37df04799a
2020-05-18 21:47:17 +01:00