RobotDryRunLibraryImportCollector { @VisibleForTesting static String formatAdditionalInfo(final String error) { return error.replaceAll("\\\\n", "\n").replaceAll("\\\\'", "'").replace( "<class 'robot.errors.DataError'>, DataError", ""); } RobotDryRunLibraryImportCollector(final Set<String> standardLibraryNames); void collectFromLibraryImportEvent(final LibraryImportEvent event); void collectFromMessageEvent(final MessageEvent event); List<RobotDryRunLibraryImport> getImportedLibraries();  }
@Test public void additionalInfoIsFormatted() throws Exception { assertThat(RobotDryRunLibraryImportCollector.formatAdditionalInfo("")).isEmpty(); assertThat(RobotDryRunLibraryImportCollector.formatAdditionalInfo("abc")).isEqualTo("abc"); assertThat(RobotDryRunLibraryImportCollector.formatAdditionalInfo("a\\nb\\nc")).isEqualTo("a\nb\nc"); assertThat(RobotDryRunLibraryImportCollector.formatAdditionalInfo("a\\'b\\'c")).isEqualTo("a'b'c"); assertThat(RobotDryRunLibraryImportCollector.formatAdditionalInfo("a\\nb\\'c\\'\\nd")).isEqualTo("a\nb'c'\nd"); assertThat(RobotDryRunLibraryImportCollector .formatAdditionalInfo("(<class 'robot.errors.DataError'>, DataError(u'message'), traceback)")) .isEqualTo("((u'message'), traceback)"); }