Skip to content

Commit 4d9885e

Browse files
committed
malva: Pattern.quote test case
Signed-off-by: Pekka Enberg <penberg@kernel.org>
1 parent 0d64338 commit 4d9885e

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ CLASSES += src/malva/java/lang/ThreadTest.class
3131
CLASSES += src/malva/java/lang/ThrowableTest.class
3232
CLASSES += src/malva/java/net/InetAddressTest.class
3333
CLASSES += src/malva/java/net/NetworkInterfaceTest.class
34+
CLASSES += src/malva/java/util/regex/PatternTest.class
3435

3536
SRC := $(patsubst %.class,%.java,$(CLASSES))
3637

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package malva.java.util.regex;
2+
3+
import java.util.regex.Pattern;
4+
5+
import malva.TestCase;
6+
7+
public class PatternTest extends TestCase {
8+
// compile
9+
// flags
10+
// matcher
11+
// pattern
12+
13+
public static void testQuote() {
14+
assertThrows(new Block() {
15+
@Override public void run() throws Throwable {
16+
Pattern.quote(null);
17+
}
18+
}, NullPointerException.class);
19+
assertEquals("\\Qhello, world\\E", Pattern.quote("hello, world"));
20+
}
21+
22+
// split
23+
// toString
24+
25+
public static void main(String[] args) {
26+
testQuote();
27+
}
28+
}

0 commit comments

Comments
 (0)