summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-04-29 17:06:30 +0200
committerPeter Wu <peter@lekensteyn.nl>2016-04-29 17:06:30 +0200
commitcc66b84299cb8ac42beda43718c4ceccbf16f41c (patch)
tree16b3e9dd1555b2fdec1959cde5d3af69c9e110df
parentdfee84640f6d3c04be41d7789671153743a6764f (diff)
downloadRegexTest-cc66b84299cb8ac42beda43718c4ceccbf16f41c.tar.gz
Add more tests matching slides
Also remove tests with letters "s" and "Id" in it, these are not interesting to test. Add some more tests to catch capital "E" and reject a lone "e7".
-rw-r--r--src/regex/RegexTest.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/regex/RegexTest.java b/src/regex/RegexTest.java
index 857f61d..56d49bb 100644
--- a/src/regex/RegexTest.java
+++ b/src/regex/RegexTest.java
@@ -88,16 +88,20 @@ public class RegexTest {
String Number = UnsignedInt + "|" + UnsignedReal;
RegexTest reFLOAT = new RegexTest(Number);
- reFLOAT.assertOk("3.14e-7");
- reFLOAT.assertFail("3.14e-07");
+ reFLOAT.assertOk("0");
reFLOAT.assertOk("1");
+ reFLOAT.assertOk("14");
reFLOAT.assertOk("0.1");
reFLOAT.assertOk("3e4");
+ reFLOAT.assertOk("3.014e-7");
+ reFLOAT.assertOk("3.14E-7");
reFLOAT.assertFail("00");
- reFLOAT.assertFail("01s");
- reFLOAT.assertFail("Id");
- reFLOAT.assertFail("-145711");
+ reFLOAT.assertFail("01");
reFLOAT.assertFail("04.1");
+ reFLOAT.assertFail("3e04");
+ reFLOAT.assertFail("3.14e-07");
+ reFLOAT.assertFail("");
+ reFLOAT.assertFail("e7");
System.out.println();
}