Commit graph

17 commits

Author SHA1 Message Date
addshore
9e85aabe52 Cleanup a bunch of tests and add todos
Change-Id: Iae44427edee3ed2a62abdb5a8f5d9f1ed2e7d660
2014-03-09 15:12:45 +01:00
addshore
749599fc3c @covers tags for unit tests
Change-Id: I2b486b38326bf23bd379efba2142034e24c0745f
2013-10-24 18:22:57 +01:00
addshore
de7af7ac2c Fix scope on all /phpunit test methods
Change-Id: I3ce92463d485a0fb23e464e9a8059330f32d79af
2013-10-24 10:31:32 +02:00
Timo Tijhof
b36d883017 Tests: Make phpunit providers "public static".
Follows-up I9d2b148e57 (including phpunit/languages this time).

Bug: 46434
Change-Id: I30e5efcd88c516121c454676bd7a18f9b7c8fca6
2013-03-22 03:12:37 +01:00
Siebrand Mazeland
de04f37ef1 Update formatting
5 of n.

Change-Id: I811ca957b6588085d67606ebc0cd4033a1e53839
2013-02-15 12:35:50 +00:00
Timo Tijhof
c33087beaa JavaScriptMinifierTest: Increase test coverage
* Per https://bugzilla.wikimedia.org/show_bug.cgi?id=27395#c1
  adding test cases for things that broke in the past:
  - bug 26931
  - bug 27046

* Added various other small tests that seem fitting in their context

* Moved testBug32548Exponent to below the data provider (like most
  other tests iirc).

Change-Id: I7a4df097108ec05bc58d5a110329e13ff9587c8a
2012-06-20 05:18:39 +02:00
Brion Vibber
e97346ec18 Revert r103978, r103979 -- screwed something up, breaks jQuery minification.
Incremented ResourceLoader::filterCacheVersion rather than decrementing to avoid potential confusion, especially since we already needed the incr.
2011-11-23 00:22:46 +00:00
Brion Vibber
6b06770b6d Followup r103865 and r103915
r103915 added a parse error for 'more than 2 decimal points' in a number; this is the wrong place to check for that. Should only check whether there's more digits or identifier chars -- identifier chars would be illegal.

Added test cases for the exponent missing fails, tweaked it to be more consistent (only need to check for one e; if we have more we can lump them in with 'not digits' :)


Also cleaned up no-longer-needed suppress/restore warnings around JS parser invocation
2011-11-22 23:10:22 +00:00
Platonides
a82a7940f6 Final fixup to r103910 and follow-ups.
Reverts r103931 test change.
2011-11-22 18:56:55 +00:00
Platonides
6cac97e88c Two decimal points may be valid, as 5..toString() == (5.).toString()
Added some tests
2011-11-22 18:42:21 +00:00
Platonides
b23dc2f758 Follow-up r103915: We need to increment $end before the strcspn.
Adjusting the tests, since it is now adding the newline after the number.
2011-11-22 18:10:25 +00:00
Brion Vibber
8bf802734c Add PHPUnit tests for the minification failure case in bug 32548.
This will trigger 2 test failures, where an exponent in a JS numeric literal gets split over line breaks at the '-' or '+', causing a parse error in the resulting output.
A number with the same string length but without using + or - in the exponent passes through fine, indicating that it's the -/+ that's getting misinterpreted.
2011-11-21 22:20:06 +00:00
Brion Vibber
72ba305da4 * (bug 31187) Fix for user JavaScript validation to allow identifiers with valid Unicode letter characters
Followup r91591, r93020: patch to jsminplus to support Unicode chars and char escapes in identifiers

Fast-path check keeps runtime about the same on most scripts (eg jquery.js parsing was abround 4100ms both before and after on my test machine)
Slow-path code kicks in if plain ASCII word chars don't extend all the way to the next whitespace or punctuation char.
Using PCRE's Unicode properties magic to ensure that we're catching everything, following ECMA-262 edition 5.1 spec.

Note that identifiers using escapes don't get normalized to their UTF-8 form; this might be a nice thing to do as it saves a couple bytes, but currently there's no change made to output.


Added QUnit tests to verify that unicode letter & escapes work in identifiers in all supported browsers (ok back to IE 6, yay)
2011-09-27 22:51:36 +00:00
Brion Vibber
12ccca0349 Followup r83885: add JSMin+ 1.3 to use its parser to verify output of JavaScriptMinifierTest unit test cases. Had to change some of the test cases because they were not valid JavaScript programs -- one of the quoting tests was incorrectly quoted in the PHP sources, and several tests around return, continue, and break keywords failed due to not using them in the contexts that they require.
http://crisp.tweakblogs.net/blog/1856/jsmin+-version-13.html
JSMin+ under MPL 1.1/ GPL 2.0 / LGPL 2.1 license.
2011-07-06 20:02:10 +00:00
Roan Kattouw
27508f06af Followup r83891: don't insert a newline before ++ or -- . Patch by Paul Copperman 2011-03-14 18:04:39 +00:00
Roan Kattouw
5ce4ecfced Per Nikerabbit, add some minifier tests for historic failure cases that I had lying around 2011-03-14 13:55:42 +00:00
Roan Kattouw
867fc1cba8 (bug 27528) Incorporate Paul Copperman's minifier 2011-03-14 11:44:33 +00:00