diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-10-14 16:24:20 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-10-14 16:24:20 +0200 |
commit | 99aacf951c793054df267753c46b5f86c65bb2f4 (patch) | |
tree | 38a1a3c1e40b77dac9670f9ee1f423bba6c79a3a /_test | |
parent | d8101e8567b7c50dff4936f6643f2d044c1038f7 (diff) | |
parent | 70daee86e69783928d3da887a3a3e26b8ab74734 (diff) | |
download | rpg-99aacf951c793054df267753c46b5f86c65bb2f4.tar.gz rpg-99aacf951c793054df267753c46b5f86c65bb2f4.tar.bz2 |
Merge pull request #901 from LarsGit223/master
Corrected compression for ++ and -- operator. Partially fixes #897.
Diffstat (limited to '_test')
-rw-r--r-- | _test/tests/lib/exe/js_js_compress.test.php | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/_test/tests/lib/exe/js_js_compress.test.php b/_test/tests/lib/exe/js_js_compress.test.php index b1ae2a84f..78e089d89 100644 --- a/_test/tests/lib/exe/js_js_compress.test.php +++ b/_test/tests/lib/exe/js_js_compress.test.php @@ -145,6 +145,66 @@ EOF; $this->assertEquals($out, js_compress($text)); } + function test_plusplus1(){ + $text = 'a = 5 + ++b;'; + $this->assertEquals('a=5+ ++b;',js_compress($text)); + } + + function test_plusplus2(){ + $text = 'a = 5+ ++b;'; + $this->assertEquals('a=5+ ++b;',js_compress($text)); + } + + function test_plusplus3(){ + $text = 'a = 5++ + b;'; + $this->assertEquals('a=5++ +b;',js_compress($text)); + } + + function test_plusplus4(){ + $text = 'a = 5++ +b;'; + $this->assertEquals('a=5++ +b;',js_compress($text)); + } + + function test_minusminus1(){ + $text = 'a = 5 - --b;'; + $this->assertEquals('a=5- --b;',js_compress($text)); + } + + function test_minusminus2(){ + $text = 'a = 5- --b;'; + $this->assertEquals('a=5- --b;',js_compress($text)); + } + + function test_minusminus3(){ + $text = 'a = 5-- - b;'; + $this->assertEquals('a=5-- -b;',js_compress($text)); + } + + function test_minusminus4(){ + $text = 'a = 5-- -b;'; + $this->assertEquals('a=5-- -b;',js_compress($text)); + } + + function test_minusplus1(){ + $text = 'a = 5-- +b;'; + $this->assertEquals('a=5--+b;',js_compress($text)); + } + + function test_minusplus2(){ + $text = 'a = 5-- + b;'; + $this->assertEquals('a=5--+b;',js_compress($text)); + } + + function test_plusminus1(){ + $text = 'a = 5++ - b;'; + $this->assertEquals('a=5++-b;',js_compress($text)); + } + + function test_plusminus2(){ + $text = 'a = 5++ -b;'; + $this->assertEquals('a=5++-b;',js_compress($text)); + } + /** * Test the files provided with the original JsStrip */ |