From b0d2046fe1f573e2e6c157bbaaae38f048462880 Mon Sep 17 00:00:00 2001 From: David Chen Date: Tue, 1 Mar 2016 01:17:26 +0000 Subject: Add support for additional edge cases to RuleLinkExpander. * Add support for rules with capital letters, such as Fileset * Add support for static page headings with periods. * Run the expander on the HTML doc for the name attribute. * Add functions to initial rule index. -- MOS_MIGRATED_REVID=115925884 --- .../devtools/build/docgen/RuleLinkExpanderTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/test/java/com/google/devtools') diff --git a/src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java b/src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java index 2694b0e464..60e6377569 100644 --- a/src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java +++ b/src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java @@ -32,6 +32,7 @@ public class RuleLinkExpanderTest { .put("cc_library", "c-cpp") .put("cc_binary", "c-cpp") .put("java_binary", "java") + .put("Fileset", "fileset") .put("proto_library", "protocol-buffer") .build()); } @@ -48,6 +49,12 @@ public class RuleLinkExpanderTest { assertEquals(expected, expander.expand(docs)); } + @Test public void testUpperCaseRule() { + String docs = "entries"; + String expected = "entries"; + assertEquals(expected, expander.expand(docs)); + } + @Test public void testRuleExamples() { String docs = "examples"; String expected = "examples"; @@ -72,6 +79,14 @@ public class RuleLinkExpanderTest { assertEquals(expected, expander.expand(docs)); } + @Test public void testStaticPageWithPeriodsInHeading() { + String docs = + "genrule cmd"; + String expected = + "genrule cmd"; + assertEquals(expected, expander.expand(docs)); + } + @Test(expected = IllegalArgumentException.class) public void testRefNotFound() { String docs = "bar"; -- cgit v1.2.3