Commit graph

61 commits

Author SHA1 Message Date
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
lupo
5b9731e08a (bug 36839) Use mb_check_encoding() if available.
This is not a real fix for the cause of the bug (which is a
pcre.recursion_limit that is far too low), but I do wonder
about the efficiency of using a regexp to test for valid
UTF-8 encoding. After all the regexp has to be compiled first
into a state machine.

Patch set 2: Php unit test for Language.checkTitleEncoding
Patch set 3: benchmark
Patch set 4: add benchmark for non-capturing subgroup in regexp, and
since that's faster than a capturing subgroup, use it in
checkTitleEncoding() in the regexp branch.
Patch set 5: use Tim's suggestion (once-only pattern) in the regexp
branch. Also add to benchmark.

Change-Id: I551f096921d4c9c57cbcb091b80ab5970ca86a9b
2012-05-31 14:21:36 +02:00
Aaron Schulz
e515d15f3a Revert "tests to compare En, Qqq and messages.inc" due to test failures caused by extension dependencies.
This reverts commit 9a2aae3107
2012-04-20 21:12:08 +00:00
Antoine Musso
9a2aae3107 tests to compare En, Qqq and messages.inc
Change-Id: I7ebeeea703e955c628b57548eb023fa3eb5a2f52
2012-04-20 18:08:33 +02:00
Jeroen De Dauw
77d2f16760 duration formatter, makes time in sec easy to read
The Language::formatDuration() method introduced by this patch let us
easily render an amount of seconds for easier human reading.

 $ maintenance/eval.php
 > var_dump( $wgLang->formatDuration( 1000 );
 string(25) "16 minutes and 40 seconds"

Also ran rebuildLanguage.php on Siebrands request

Change-Id: If287fb10e897d3d2374cf6eeae3bc5be00cdfc01
2012-04-13 13:54:04 +02:00
Nikola Smolenski
598d96d24c - Fix bug 35076
- More tests, test comments

(This is the same as r114049.)

Patch set 2: Squash in missed test file

Change-Id: Icaf7fdd11499c64c42b46e442c158f22309345a7
2012-04-10 13:39:46 -04:00
Sam Reed
c27fbf5330 Trim trailing whitespace
Add/improve documentation

Explicitly define a few variables

Change-Id: If0017770a0a47f8f6be178b5bde8ae6691f74b6a
2012-03-21 15:47:05 -07:00
Roan Kattouw
311200ee2c Revert r114067, r114071, r114075, r114079, r114081, r114082, r114084, r114086, r114088, r114089, r114101, r114118, r114137, r114147, r114164, r114172, r114175, r114180, r114208, r114209, r114215, r114219, r114226, r114321, r114322.
This reverts the SpecialCachedPage and formatDuration sagas, with some collateral damage here and there. All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html
2012-03-20 23:03:59 +00:00
Jeroen De Dauw
d42c2f4d7a added some tests using the intervals param 2012-03-20 22:48:28 +00:00
Jeroen De Dauw
bc9cca92ed follow up to r114084, add tests for stuff w/ multiple units 2012-03-17 23:26:37 +00:00
Sam Reed
a2dc33a5a3 Trim trailing whitespace
Add/improve documentation

Explicitly define a few variables
2012-03-17 22:52:54 +00:00
Sam Reed
e8ab5f6466 Noralise a few of the magic numbers used in r114084 2012-03-17 22:47:02 +00:00
Sam Reed
5736aa4132 Unit tests for r114067 2012-03-17 22:39:38 +00:00
Niklas Laxström
17c9d085c8 Whitespace cleanup 2012-02-02 11:14:26 +00:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Amir E. Aharoni
5b7484cfe3 Added tests for plural, same as Russian. 2012-02-01 15:59:26 +00:00
Amir E. Aharoni
655dbec995 Fixed plural rules for Romanian / Moldovan according to CLDR. Added tests for Romanian and fixed tests for Moldovan. 2012-02-01 15:37:40 +00:00
Amir E. Aharoni
05070ac01c Adding plural tests for more languages. 2012-02-01 04:53:55 +00:00
Amir E. Aharoni
adf5248562 Testing the case when dual is not provided. 2012-01-31 14:42:38 +00:00
Amir E. Aharoni
b8cc074d88 Adding tests for plural in Hebrew. 2012-01-31 13:49:36 +00:00
Santhosh Thottingal
4682c16bc3 Followup r110279. $count % 100 in 1..19 is few form.
In r110279, it was 2..19.
2012-01-30 13:51:04 +00:00
Santhosh Thottingal
6fd023b9c5 phpunit testcases for lv, mg,and ml languages to test Plural 2012-01-30 11:40:28 +00:00
Santhosh Thottingal
4f2eaa8d80 For Moldavian $count % 100 < 20 is not 'few' form, but $count % 100 in 1..19 is few form.
This was causing 200 considered as 'few' form, while it should be 'other' form as per
http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#mo

Add phpunit test cases for LanguageMo plural rules
2012-01-30 11:34:36 +00:00
Santhosh Thottingal
17eb54b617 Add PHPUnit tests for plural rules. For languages cs, cu, cy, dsb, fr, ga, gd, gv, hr, hsb, hy, ksh, ln 2012-01-27 11:13:06 +00:00
Santhosh Thottingal
97c25c61aa phpunit testcases on the plural rules for am, ar, be, be_tarask, bh, bs and hi languages 2012-01-27 06:01:43 +00:00
Santhosh Thottingal
c652c3ba7f Use dataprovider for testcases. 2012-01-27 05:58:46 +00:00
Antoine Musso
de46c34467 fix '999bps' test message
follow r108413
2012-01-09 19:38:38 +00:00
Chad Horohoe
34244403d7 Followup r108403, use data providers 2012-01-09 16:51:34 +00:00
Antoine Musso
655bef2ae1 test format bitrate with '999' 2012-01-09 14:01:51 +00:00
Santhosh Thottingal
266c6e8515 Cleanup the convertPLural method for Lithuanian(lt)
Add phpunit test cases.
2012-01-09 12:46:53 +00:00
Santhosh Thottingal
ad13e54f84 Address an edge case - input being null. Add test cases. 2012-01-04 08:56:36 +00:00
Brian Wolff
9faf44cf58 Follow-up r107806 - More extensive tests for Language::sprintfDate. Including test to make sure not affected by php timezone.
Also adds a small test for converting numerals (formatNum) in Arabic.
2012-01-02 10:41:58 +00:00
Sam Reed
cea7c863e5 Prevent undefined offset when formatBitrate is given a significantly large enough number (10^27)
> echo $wgLang->formatBitrate( pow( 10, 27 ) );
PHP Notice:  Undefined offset: 9 in /home/reedy/mediawiki/trunk/phase3/languages/Language.php on line 3827
PHP Stack trace:
PHP   1. {main}() /home/reedy/mediawiki/trunk/phase3/maintenance/eval.php:0
PHP   2. eval() /home/reedy/mediawiki/trunk/phase3/maintenance/eval.php:82
PHP   3. Language->formatBitrate() /home/reedy/mediawiki/trunk/phase3/maintenance/eval.php(82) : eval()'d code:1

Notice: Undefined offset: 9 in /home/reedy/mediawiki/trunk/phase3/languages/Language.php on line 3827

Call Stack:
    0.0006     650736   1. {main}() /home/reedy/mediawiki/trunk/phase3/maintenance/eval.php:0
   61.6539   21593432   2. eval(''echo $wgLang->formatBitrate( pow( 10, 27 ) );;'') /home/reedy/mediawiki/trunk/phase3/maintenance/eval.php:82
   61.6540   21593512   3. Language->formatBitrate() /home/reedy/mediawiki/trunk/phase3/maintenance/eval.php(82) : eval()'d code:1

1bps
2011-12-31 22:53:50 +00:00
Sam Reed
450ad142b9 Fixup and add rest of tests
Followup r107734

bug 33014 done too?
2011-12-31 22:30:31 +00:00
Sam Reed
f2c6e0afb6 Shut up Jenkins!
Ping r107734
2011-12-31 21:01:30 +00:00
Sam Reed
ef30bc81d0 Start adding tests for Language::formatBitrate()
1Gbps commented out as for some reason it's returning 1.1Gbps...
2011-12-31 20:30:06 +00:00
Sam Reed
3b06d6fbc9 Followup r106791, r107692 and bug 33014
Make Language::formatNum() handle  TB through YB

Rewrote code to be simpler and less indenty

Though, something like formatBitrate might be be better in future... We'll see!
2011-12-31 20:20:15 +00:00
Sam Reed
fa9efe332d Add some tests for formatSize 2011-12-31 02:13:59 +00:00
Brion Vibber
f1ce2ce952 * (bug 32461) Add two-digit short form year for Persian calendar ({{#time:xiy}})
Patch by Platonides https://bugzilla.wikimedia.org/attachment.cgi?id=9490&action=diff
Plus test case. Note the test case uses Latin-style digits because it's testing English; in fa you'd get the persian digits as in the examples on the bug.
2011-12-14 00:32:56 +00:00
Antoine Musso
464d9c071b bug 28643 improvement to serbian variants conversion
This patch is a PARTIAL merge of /branches/nikola/phase3 ::

r85224 avoid double conversion when text already use the correct variant
r85239 minor fixes to previous
r85308 documentation (@since 1.18 update to 1.19)
r101359 guessVariant doc + boolean typecast
r101369 tests
r103131 additional test

Test plan:
==========
$ ./phpunit.php --filter LanguageSr
PHPUnit 3.6.3 by Sebastian Bergmann.

Configuration read from /srv/trunk/tests/phpunit/suite.xml

.....

Time: 1 second, Memory: 78.50Mb

OK (5 tests, 19 assertions)
$
2011-11-16 15:12:00 +00:00
Santhosh Thottingal
a4bc93ae50 Follow up r102802. Bug 32359
Use negative sign itself instead of $_[0] since $_ is mixed type.
Add more test cases.
2011-11-15 04:28:34 +00:00
Santhosh Thottingal
8ec9d7072e Make commafy support negative numbers too,
Add test cases.
Ref Bug 32359  and Followup r97793
2011-11-11 17:23:12 +00:00
Antoine Musso
c1f23144e1 using real identity for hashar
Converting my pseudonym to use my real identity instead:
Ashar Voultoiz -> Antoine Musso
2011-10-24 09:08:13 +00:00
Brion Vibber
9252e92c99 followup r99246: fixes for test cases 2011-10-08 00:27:53 +00:00
Roan Kattouw
0e52aee608 Per CR on r97962, introduce an array parameter for formatTimePeriod() rather than adding more boolean params. 2011-09-24 15:44:43 +00:00
Roan Kattouw
e5a9b38294 Make Language::formatTimePeriod() more flexible so it can produce stuff like '3 hours ago'.
* Add a $noAbbrevs parameter that causes the 'seconds', 'minutes', etc. messages to be used instead of the 'seconds-abbrev', 'minutes-abbrev', etc. messages
* Add the 'seconds', 'minutes', 'hours' and 'days' messages
* Change the -abbrev messages to take a parameter rather than having the number prepended to them. This is for compatibility with 'seconds' et al, which need the parameter for {{PLURAL:}}. It also generally makes more sense. This does BREAK the messages in non-English languages that override them; Niklas told me to leave this alone and ping the TranslateWiki folks
* Introduce an 'ago' message for '$1 ago'. Not currently used in core, but I want to use it in an extension and it seemed stupid not to have such a thing in core.
* Refactor the function to use message objects and pass the number as a parameter
* Add tests! They exposed a subtle bug in my first iteration; all hail tests!
2011-09-23 22:17:10 +00:00
Roan Kattouw
e9e287d1de Rewrite testFormatTimePeriod() with a data provider 2011-09-23 22:02:36 +00:00
Santhosh Thottingal
88bdda41b1 Add support for Number grouping(commafy) based on CLDR number grouping patterns like ##,##,###.
Testcases for Malayalam and Dutch
Number grouping Patterns added to Ml and Hi Message classes.
Reference: Bug 29495
2011-09-22 05:01:19 +00:00
Roan Kattouw
6a8cb49f82 Per CR on r90915, fix the description of one of the assertions 2011-08-20 09:59:00 +00:00