Skip to content

Commit

Permalink
Try again
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanConfluent committed Apr 3, 2020
1 parent 7a92436 commit 4e255f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public static boolean isUnclosedQuote(final String line) {
for (int i = 0; line != null && i < line.length(); ++i) {
if (quoteStart < 0 && isQuoteChar(line, i)) {
quoteStart = i;
} else if (quoteStart >= 0 && line.charAt(quoteStart) == line.charAt(i)
&& !isEscaped(line, i)) {
} else if (quoteStart >= 0 && isQuoteChar(line, i) && !isEscaped(line, i)) {
quoteStart = -1;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class UnclosedQuoteCheckerTest {
@Test
public void shouldFindUnclosedQuote() {
// Given:
final String line = "some line 'this is in a comment";
final String line = "some line 'this is in a quote";

// Then:
Assert.assertTrue(UnclosedQuoteChecker.isUnclosedQuote(line));
Expand All @@ -32,7 +32,7 @@ public void shouldFindUnclosedQuote() {
@Test
public void shouldFindUnclosedQuote_escaped() {
// Given:
final String line = "some line 'this is in a comment\\'";
final String line = "some line 'this is in a quote\\'";

// Then:
Assert.assertTrue(UnclosedQuoteChecker.isUnclosedQuote(line));
Expand All @@ -59,7 +59,7 @@ public void shouldNotFindUnclosedQuote_endsNonQuote() {
@Test
public void shouldNotFindUnclosedQuote_inComment() {
// Given:
final String line = "some line -- 'this is in a quote";
final String line = "some line -- 'this is in a comment";

// Then:
Assert.assertFalse(UnclosedQuoteChecker.isUnclosedQuote(line));
Expand Down

0 comments on commit 4e255f0

Please sign in to comment.