diff options
author | LarsDW223 <lars_paulsen@web.de> | 2014-10-15 10:57:00 +0200 |
---|---|---|
committer | LarsDW223 <lars_paulsen@web.de> | 2014-10-15 10:57:00 +0200 |
commit | 6275d9067f8a0a7216fece2d49ba2064967bc194 (patch) | |
tree | 762d7bd7d64f22c55e08e917a29b2735bef10600 /_test | |
parent | 5c5b52fd17bf855ab64656790b39ff43450902c9 (diff) | |
download | rpg-6275d9067f8a0a7216fece2d49ba2064967bc194.tar.gz rpg-6275d9067f8a0a7216fece2d49ba2064967bc194.tar.bz2 |
Ooops...forgot to commit test cases for #897.
Diffstat (limited to '_test')
-rw-r--r-- | _test/tests/lib/exe/js_js_compress.test.php | 18 |
1 files changed, 18 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 78e089d89..648ede07e 100644 --- a/_test/tests/lib/exe/js_js_compress.test.php +++ b/_test/tests/lib/exe/js_js_compress.test.php @@ -58,6 +58,18 @@ class js_js_compress_test extends DokuWikiTest { $this->assertEquals(js_compress($text), 'text.replace(/"/,"//")'); } + function test_regex_after_and_with_slashes_outside_string(){ + $text = 'if ( peng == bla && /pattern\//.test(url)) request = new Something();'; + $this->assertEquals(js_compress($text), + 'if(peng==bla&&/pattern\//.test(url))request=new Something();'); + } + + function test_regex_after_or_with_slashes_outside_string(){ + $text = 'if ( peng == bla || /pattern\//.test(url)) request = new Something();'; + $this->assertEquals(js_compress($text), + 'if(peng==bla||/pattern\//.test(url))request=new Something();'); + } + function test_dquot1(){ $text = 'var foo="Now what \\" \'do we//get /*here*/ ?";'; $this->assertEquals(js_compress($text), $text); @@ -205,6 +217,12 @@ EOF; $this->assertEquals('a=5++-b;',js_compress($text)); } + function test_unusual_signs(){ + $text='var π = Math.PI, τ = 2 * π, halfπ = π / 2, ε = 1e-6, ε2 = ε * ε, radians = π / 180, degrees = 180 / π;'; + $this->assertEquals(js_compress($text), + 'var π=Math.PI,τ=2*π,halfπ=π/2,ε=1e-6,ε2=ε*ε,radians=π/180,degrees=180/π;'); + } + /** * Test the files provided with the original JsStrip */ |