summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorLarsDW223 <lars_paulsen@web.de>2014-10-14 16:12:08 +0200
committerLarsDW223 <lars_paulsen@web.de>2014-10-14 16:12:08 +0200
commit70daee86e69783928d3da887a3a3e26b8ab74734 (patch)
tree6b3d3ad404b530a246d38c2b2cef77bceddf1b59 /_test
parentb2e6a1f4afcd548dbd5bc6af110940b08b9f1a88 (diff)
downloadrpg-70daee86e69783928d3da887a3a3e26b8ab74734.tar.gz
rpg-70daee86e69783928d3da887a3a3e26b8ab74734.tar.bz2
Corrected compression for ++ and -- operator. Partially fixes #897.
Diffstat (limited to '_test')
-rw-r--r--_test/tests/lib/exe/js_js_compress.test.php60
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
*/