public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
* FYI:  Added new test
@ 2007-07-03 14:47 Tania Bento
  0 siblings, 0 replies; only message in thread
From: Tania Bento @ 2007-07-03 14:47 UTC (permalink / raw)
  To: mauve-patches

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]

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.




[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch, Size: 722 bytes --]

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
       {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-03 14:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-03 14:47 FYI: Added new test Tania Bento

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).