AsciiDocStringUtils { public static String resolveFilenameOfIncludeOrNull(String potentialInclude) { return resolveSubstringFromPrefixToStartOfLastOpeningBracket(potentialInclude, INCLUDE_PREFIX); }  static String resolveFilenameOfDiagramMacroOrNull(String potentialInclude); static String resolveFilenameOfMacroOrNull(String potentialInclude, String macroName); static String resolveFilenameOfImageOrNull(String potentialImage); static String resolveFilenameOfIncludeOrNull(String potentialInclude); static LinkTextData resolveTextFromStartToBracketsEnd(String line, int offset, int offsetInLine); static String readUTF8FileToString(File fileToRead); static File writeTextToUTF8File(String transformed, File newTempFile);  }
@Test public void resolveFilenameOfIncludeOrNull_gargamel_has_no_filename_but_null() { assertNull(resolveFilenameOfIncludeOrNull("gargamel")); }
@Test public void resolveFilenameOfIncludeOrNull_include_colon_colon_has_no_filename_but_null() { assertNull(resolveFilenameOfIncludeOrNull("include::")); }
@Test public void resolveFilenameOfIncludeOrNull_include_colon_colon_src_slash_include1_dot_java_has_no_filename_but_null() { assertNull(resolveFilenameOfIncludeOrNull("include::src/include1.java")); }
@Test public void resolveFilenameOfIncludeOrNull_include_colon_colon_src_slash_include1_dot_adoc_brackets_has_src_slash_include1_dot_adoc() { assertEquals("src/include1.adoc", resolveFilenameOfIncludeOrNull("include::src/include1.adoc[]")); }
@Test public void resolveFilenameOfIncludeOrNull_include_colon_colon_src_slash_include1_dot_java_brackets_has_src_slash_include1_dot_java() { assertEquals("src/include1.java", resolveFilenameOfIncludeOrNull("include::src/include1.java[]")); }
@Test public void resolveFilenameOfIncludeOrNull_include_colon_colon_src_slash_include1_dot_java_brackets_with_something_inside_has_src_slash_include1_dot_java() { assertEquals("src/include1.java", resolveFilenameOfIncludeOrNull("include::src/include1.java[somethinginside]")); }