diff --git a/javatests/com/google/re2j/CharClassTest.java b/javatests/com/google/re2j/CharClassTest.java index 00eea0b3..faceb1fa 100644 --- a/javatests/com/google/re2j/CharClassTest.java +++ b/javatests/com/google/re2j/CharClassTest.java @@ -7,13 +7,14 @@ package com.google.re2j; import static com.google.re2j.Utils.stringToRunes; - import static org.junit.Assert.assertEquals; import java.util.Arrays; - import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +@RunWith(JUnit4.class) public class CharClassTest { private static CharClass cc(int... x) { diff --git a/javatests/com/google/re2j/ParserTest.java b/javatests/com/google/re2j/ParserTest.java index 87cd152a..a97b7599 100644 --- a/javatests/com/google/re2j/ParserTest.java +++ b/javatests/com/google/re2j/ParserTest.java @@ -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 adonovan@google.com (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); } } diff --git a/javatests/com/google/re2j/RE2CompileTest.java b/javatests/com/google/re2j/RE2CompileTest.java index 0ac6294d..916b4002 100644 --- a/javatests/com/google/re2j/RE2CompileTest.java +++ b/javatests/com/google/re2j/RE2CompileTest.java @@ -67,7 +67,7 @@ public RE2CompileTest(String input, String expectedError) { @Test public void testCompile() { try { - RE2.compile(input); + RE2 unused = RE2.compile(input); if (expectedError != null) { fail("RE2.compile(" + input + ") was successful, expected " + expectedError); } diff --git a/javatests/com/google/re2j/RE2Test.java b/javatests/com/google/re2j/RE2Test.java index cb204dfd..cf30b3a3 100644 --- a/javatests/com/google/re2j/RE2Test.java +++ b/javatests/com/google/re2j/RE2Test.java @@ -9,13 +9,16 @@ package com.google.re2j; -import java.util.Arrays; -import org.junit.Test; - import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.util.Arrays; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + /** Tests of RE2 API. */ +@RunWith(JUnit4.class) public class RE2Test { @Test public void testFullMatch() { diff --git a/javatests/com/google/re2j/UnicodeTest.java b/javatests/com/google/re2j/UnicodeTest.java index 8309e4ef..58ee79eb 100644 --- a/javatests/com/google/re2j/UnicodeTest.java +++ b/javatests/com/google/re2j/UnicodeTest.java @@ -6,13 +6,15 @@ */ package com.google.re2j; -import org.junit.Test; +import static org.junit.Assert.*; import java.util.ArrayList; import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; -import static org.junit.Assert.*; - +@RunWith(JUnit4.class) public class UnicodeTest { @Test