-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor test fixes to enable running internally with Blaze.
PiperOrigin-RevId: 574899560
- Loading branch information
1 parent
10ba78d
commit 7339d54
Showing
5 changed files
with
23 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,16 +21,18 @@ | |
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.fail; | ||
|
||
import com.google.common.truth.Truth; | ||
import java.util.ArrayList; | ||
import java.util.EnumMap; | ||
import java.util.Map; | ||
|
||
import com.google.common.truth.Truth; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.JUnit4; | ||
|
||
/** | ||
* @author [email protected] (Alan Donovan) | ||
*/ | ||
@RunWith(JUnit4.class) | ||
public class ParserTest { | ||
|
||
private interface RunePredicate { | ||
|
@@ -405,6 +407,8 @@ private static void dumpRegexp(StringBuilder b, Regexp re) { | |
} | ||
b.append('{'); | ||
switch (re.op) { | ||
default: | ||
break; | ||
case END_TEXT: | ||
if ((re.flags & WAS_DOLLAR) == 0) { | ||
b.append("\\z"); | ||
|
@@ -583,7 +587,7 @@ public void testParseInvalidRegexps() throws PatternSyntaxException { | |
} | ||
} | ||
for (String regexp : ONLY_PERL) { | ||
Parser.parse(regexp, PERL); | ||
Regexp unused = Parser.parse(regexp, PERL); | ||
try { | ||
Regexp re = Parser.parse(regexp, POSIX); | ||
fail("parsing (POSIX) " + regexp + " should have failed, instead got " + dump(re)); | ||
|
@@ -598,7 +602,7 @@ public void testParseInvalidRegexps() throws PatternSyntaxException { | |
} catch (PatternSyntaxException e) { | ||
/* ok */ | ||
} | ||
Parser.parse(regexp, POSIX); | ||
Regexp unused = Parser.parse(regexp, POSIX); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters