summaryrefslogtreecommitdiff
path: root/tools/ahat/test/HtmlEscaperTest.java
diff options
context:
space:
mode:
author Richard Uhler <ruhler@google.com> 2017-09-22 10:56:22 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-09-22 10:56:22 +0000
commit290d692e518f44fbc1fa9ef05a8f468d37510462 (patch)
tree36294dac425bf662a9db88ab796d790d842728b5 /tools/ahat/test/HtmlEscaperTest.java
parent79bbbc1c9c40478ccf752214da9574dd22cd8b02 (diff)
parent26a982ad022a254ac57f84e996c31b4e271de028 (diff)
Merge changes I9a71ea46,Ib14c294a,Id91c2be4,I3fa77e2e
* changes: Remove last remaining guava dependencies. Use a custom parser implementation instead of perflib. Remove perflib-based native allocation registry identification. ahat: Expand test coverage using static heap dumps.
Diffstat (limited to 'tools/ahat/test/HtmlEscaperTest.java')
-rw-r--r--tools/ahat/test/HtmlEscaperTest.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/ahat/test/HtmlEscaperTest.java b/tools/ahat/test/HtmlEscaperTest.java
new file mode 100644
index 0000000000..a36db356f5
--- /dev/null
+++ b/tools/ahat/test/HtmlEscaperTest.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.ahat;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class HtmlEscaperTest {
+ @Test
+ public void tests() {
+ assertEquals("nothing to escape", HtmlEscaper.escape("nothing to escape"));
+ assertEquals("a&lt;b&gt; &amp; &quot;c&apos;d&quot;e", HtmlEscaper.escape("a<b> & \"c\'d\"e"));
+ assertEquals("adjacent &lt;&lt;&gt;&gt; x", HtmlEscaper.escape("adjacent <<>> x"));
+ assertEquals("&lt; initial", HtmlEscaper.escape("< initial"));
+ assertEquals("ending &gt;", HtmlEscaper.escape("ending >"));
+ }
+}