Skip to content
Snippets Groups Projects
Commit 6275d906 authored by LarsDW223's avatar LarsDW223
Browse files

Ooops...forgot to commit test cases for #897.

parent 5c5b52fd
No related branches found
No related tags found
No related merge requests found
......@@ -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
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment