@Test @DisplayName("handleNormalCharacter handles normal characters fine") void handleNormalCharacter() { final StringBuilder sb = new StringBuilder("a"); final StringBuilder output = new StringBuilder(); final StringBuilder original = new StringBuilder(); Escape.handleNormalCharacter(sb, output, original); assertThat(sb.length()).isEqualTo(0); assertThat(output.toString()).isEqualTo("a"); assertThat(original.toString()).isEqualTo("a"); }
static void handleNormalCharacter(StringBuilder sb, StringBuilder output, StringBuilder original) { final char ch = sb.charAt(0); if (ch == '\n' || ch == '\r') { throw new GeciException("String not terminated before eol:\n" + sb.substring(1, sb.length() > 60 ? 60 : sb.length()) + "..."); } output.append(ch); original.append(ch); sb.deleteCharAt(0); }
Escape { static void handleNormalCharacter(StringBuilder sb, StringBuilder output, StringBuilder original) { final char ch = sb.charAt(0); if (ch == '\n' || ch == '\r') { throw new GeciException("String not terminated before eol:\n" + sb.substring(1, sb.length() > 60 ? 60 : sb.length()) + "..."); } output.append(ch); original.append(ch); sb.deleteCharAt(0); } }
Escape { static void handleNormalCharacter(StringBuilder sb, StringBuilder output, StringBuilder original) { final char ch = sb.charAt(0); if (ch == '\n' || ch == '\r') { throw new GeciException("String not terminated before eol:\n" + sb.substring(1, sb.length() > 60 ? 60 : sb.length()) + "..."); } output.append(ch); original.append(ch); sb.deleteCharAt(0); }  }
Escape { static void handleNormalCharacter(StringBuilder sb, StringBuilder output, StringBuilder original) { final char ch = sb.charAt(0); if (ch == '\n' || ch == '\r') { throw new GeciException("String not terminated before eol:\n" + sb.substring(1, sb.length() > 60 ? 60 : sb.length()) + "..."); } output.append(ch); original.append(ch); sb.deleteCharAt(0); }   }
Escape { static void handleNormalCharacter(StringBuilder sb, StringBuilder output, StringBuilder original) { final char ch = sb.charAt(0); if (ch == '\n' || ch == '\r') { throw new GeciException("String not terminated before eol:\n" + sb.substring(1, sb.length() > 60 ? 60 : sb.length()) + "..."); } output.append(ch); original.append(ch); sb.deleteCharAt(0); }    }