This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Added new test


This patch adds a new test to gnu.testlet.java.lang.Integer.parseInt.
It checks that a NumberFormatException is thrown if only "+" is passed
as an argument.  I've already committed this patch.


2007-07-03  Tania Bento  <tbento@redhat.com>

        * gnu/testlet/java/lang/Integer/parseInt.java:
        (test):  Added new test.



Index: gnu/testlet/java/lang/Integer/parseInt.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Integer/parseInt.java,v
retrieving revision 1.2
diff -u -r1.2 parseInt.java
--- gnu/testlet/java/lang/Integer/parseInt.java	29 Jun 2007 19:39:44 -0000	1.2
+++ gnu/testlet/java/lang/Integer/parseInt.java	3 Jul 2007 14:27:38 -0000
@@ -95,6 +95,16 @@
 	harness.check(true);
       }
 
+    try
+    {
+      i = Integer.parseInt("+");
+	harness.fail("Single '+' must throw NumberFormatException");
+    }
+  catch (NumberFormatException nfe)
+    {
+	harness.check(true);
+    }
+  
     // In JDK1.7, '+' is considered a valid character.
     try
       {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]