Skip to content

Commit e73723f

Browse files
committed
more on error handling
1 parent 3774153 commit e73723f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/test/java/org/htmlunit/javascript/regexp/mozilla/js1_2/SimpleFormTest.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* Tests originally in '/js/src/tests/js1_2/regexp/simple_form.js'.
2525
*
2626
* @author Ahmed Ashour
27+
* @author Ronald Brill
2728
*/
2829
@RunWith(BrowserRunner.class)
2930
public class SimpleFormTest extends WebDriverTestCase {
@@ -33,7 +34,7 @@ public class SimpleFormTest extends WebDriverTestCase {
3334
* @throws Exception if the test fails
3435
*/
3536
@Test
36-
@Alerts("exception")
37+
@Alerts("TypeError")
3738
public void test1() throws Exception {
3839
test("/[0-9]{3}/('23 2 34 678 9 09')");
3940
}
@@ -43,7 +44,7 @@ public void test1() throws Exception {
4344
* @throws Exception if the test fails
4445
*/
4546
@Test
46-
@Alerts("exception")
47+
@Alerts("TypeError")
4748
public void test2() throws Exception {
4849
test("/3.{4}8/('23 2 34 678 9 09')");
4950
}
@@ -53,7 +54,7 @@ public void test2() throws Exception {
5354
* @throws Exception if the test fails
5455
*/
5556
@Test
56-
@Alerts("exception")
57+
@Alerts("TypeError")
5758
public void test3() throws Exception {
5859
test("(/3.{4}8/('23 2 34 678 9 09')).length");
5960
}
@@ -63,7 +64,7 @@ public void test3() throws Exception {
6364
* @throws Exception if the test fails
6465
*/
6566
@Test
66-
@Alerts("exception")
67+
@Alerts("TypeError")
6768
public void test4() throws Exception {
6869
test("var re = /[0-9]{3}/", "re('23 2 34 678 9 09')");
6970
}
@@ -73,7 +74,7 @@ public void test4() throws Exception {
7374
* @throws Exception if the test fails
7475
*/
7576
@Test
76-
@Alerts("exception")
77+
@Alerts("TypeError")
7778
public void test5() throws Exception {
7879
test("var re = /3.{4}8/", "re('23 2 34 678 9 09')");
7980
}
@@ -83,7 +84,7 @@ public void test5() throws Exception {
8384
* @throws Exception if the test fails
8485
*/
8586
@Test
86-
@Alerts("exception")
87+
@Alerts("TypeError")
8788
public void test6() throws Exception {
8889
test("/3.{4}8/('23 2 34 678 9 09')");
8990
}
@@ -93,7 +94,7 @@ public void test6() throws Exception {
9394
* @throws Exception if the test fails
9495
*/
9596
@Test
96-
@Alerts("exception")
97+
@Alerts("TypeError")
9798
public void test7() throws Exception {
9899
test("var re =/3.{4}8/", "(re('23 2 34 678 9 09')).length");
99100
}
@@ -103,7 +104,7 @@ public void test7() throws Exception {
103104
* @throws Exception if the test fails
104105
*/
105106
@Test
106-
@Alerts("exception")
107+
@Alerts("TypeError")
107108
public void test8() throws Exception {
108109
test("(/3.{4}8/('23 2 34 678 9 09')).length");
109110
}
@@ -120,7 +121,7 @@ private void test(final String initialScript, final String script) throws Except
120121
html += initialScript + ";\n";
121122
}
122123
html += " log(" + script + ");\n"
123-
+ "} catch (e) { log('exception'); }\n"
124+
+ "} catch (e) { log(e.name); }\n"
124125
+ "</script></head><body>\n"
125126
+ "</body></html>";
126127
loadPageVerifyTitle2(html);

0 commit comments

Comments
 (0)