@Test public void isEscapedCharacter_should_work() { assertThat(cut.isEscapedCharacter("'", 0)).isFalse(); assertThat(cut.isEscapedCharacter("a'", 1)).isFalse(); assertThat(cut.isEscapedCharacter("aa'", 2)).isFalse(); assertThat(cut.isEscapedCharacter("a\\'", 2)).isTrue(); assertThat(cut.isEscapedCharacter("aa\\'", 3)).isTrue(); assertThat(cut.isEscapedCharacter("\\'", 1)).isTrue(); assertThat(cut.isEscapedCharacter("\\\\'", 2)).isFalse(); assertThat(cut.isEscapedCharacter("\\\\\\'", 3)).isTrue(); assertThat(cut.isEscapedCharacter("\\\\\\\\'", 4)).isFalse(); assertThat(cut.isEscapedCharacter("\\\\\\\\\\'", 5)).isTrue(); assertThat(cut.isEscapedCharacter("\\\\\\\\\\\\'", 6)).isFalse(); }
boolean isEscapedCharacter(String javaScript, int characterIndex) { int backslashCount = 0; for (int i = characterIndex - 1; i >= 0; i--) { if (javaScript.charAt(i) == '\\') { backslashCount++; } else { break; } } return (backslashCount % 2 == 1); }
PostmanScenarioIndexerService { boolean isEscapedCharacter(String javaScript, int characterIndex) { int backslashCount = 0; for (int i = characterIndex - 1; i >= 0; i--) { if (javaScript.charAt(i) == '\\') { backslashCount++; } else { break; } } return (backslashCount % 2 == 1); } }
PostmanScenarioIndexerService { boolean isEscapedCharacter(String javaScript, int characterIndex) { int backslashCount = 0; for (int i = characterIndex - 1; i >= 0; i--) { if (javaScript.charAt(i) == '\\') { backslashCount++; } else { break; } } return (backslashCount % 2 == 1); }  }
PostmanScenarioIndexerService { boolean isEscapedCharacter(String javaScript, int characterIndex) { int backslashCount = 0; for (int i = characterIndex - 1; i >= 0; i--) { if (javaScript.charAt(i) == '\\') { backslashCount++; } else { break; } } return (backslashCount % 2 == 1); }  List<Scenario> extractScenarios(Source source, File zipFile); }
PostmanScenarioIndexerService { boolean isEscapedCharacter(String javaScript, int characterIndex) { int backslashCount = 0; for (int i = characterIndex - 1; i >= 0; i--) { if (javaScript.charAt(i) == '\\') { backslashCount++; } else { break; } } return (backslashCount % 2 == 1); }  List<Scenario> extractScenarios(Source source, File zipFile);  }