summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-03-15 21:29:33 +0100
committerAndreas Gohr <andi@splitbrain.org>2014-03-15 21:29:33 +0100
commitf8fb2d1811251304687b805a60b489f63cb5c4fb (patch)
tree9b520bb7e91a5ae13d9a13787308592319af65cf /_test
parent1359eacbdbff842b241a85ea274a00982fec9267 (diff)
downloadrpg-f8fb2d1811251304687b805a60b489f63cb5c4fb.tar.gz
rpg-f8fb2d1811251304687b805a60b489f63cb5c4fb.tar.bz2
strip sourcemaps in CSS and JS #601
source maps are invalid for our dispatched sources and may even cause problems. this makes sure any sourcemap declarations are stripped from the output
Diffstat (limited to '_test')
-rw-r--r--_test/tests/inc/common_stripsourcemaps.test.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/_test/tests/inc/common_stripsourcemaps.test.php b/_test/tests/inc/common_stripsourcemaps.test.php
new file mode 100644
index 000000000..c6a915dcf
--- /dev/null
+++ b/_test/tests/inc/common_stripsourcemaps.test.php
@@ -0,0 +1,29 @@
+<?php
+
+class common_stripsourcemaps_test extends DokuWikiTest {
+
+ function test_all() {
+
+ $text = <<<EOL
+//@ sourceMappingURL=/foo/bar/xxx.map
+//# sourceMappingURL=/foo/bar/xxx.map
+/*@ sourceMappingURL=/foo/bar/xxx.map */
+/*# sourceMappingURL=/foo/bar/xxx.map */
+bang
+EOL;
+
+ $expect = <<<EOL
+//
+//
+/**/
+/**/
+bang
+EOL;
+
+ stripsourcemaps($text);
+
+
+ $this->assertEquals($expect, $text);
+ }
+
+} \ No newline at end of file