chiark / gitweb /
doxygen: test the HTML escaping a bit more.
authorVladimír Vondruš <mosra@centrum.cz>
Wed, 2 Jan 2019 20:54:51 +0000 (21:54 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Wed, 2 Jan 2019 21:07:36 +0000 (22:07 +0100)
I got confused by how Chrome displays plain text in the developer
console (there's no escaping visible), so extending the test a bit to be
absolutely really sure that it's correct :D

doxygen/test/test-search.js

index ead76881707f348791e61773468df5187dc6e21b..62615b7f4823f00313b031c5f86ee549dde914d4 100644 (file)
@@ -33,11 +33,20 @@ const { StringDecoder } = require('string_decoder');
 
 /* HTML escaping with RTL workarounds */
 {
+    assert.equal(Search.escape("foo()"), "foo()");
     assert.equal(Search.escapeForRtl("foo()"), "foo(&lrm;)&lrm;");
+
+    assert.equal(Search.escape("Dir/"), "Dir/");
     /* Not sure why / and & has to be escaped from both sides */
     assert.equal(Search.escapeForRtl("Dir/"), "Dir&lrm;/&lrm;");
+
+    assert.equal(Search.escape("foo() &&"), "foo() &amp;&amp;");
     assert.equal(Search.escapeForRtl("foo() &&"), "foo(&lrm;)&lrm; &lrm;&amp;&lrm;&lrm;&amp;&lrm;");
+
+    assert.equal(Search.escape("operator=()"), "operator=()");
     assert.equal(Search.escapeForRtl("operator=()"), "operator&lrm;=(&lrm;)&lrm;");
+
+    assert.equal(Search.escape("NS::Class<int>"), "NS::Class&lt;int&gt;");
     assert.equal(Search.escapeForRtl("NS::Class<int>"), "NS&lrm;:&lrm;:Class&lt;int&lrm;&gt;&lrm;");
 }