public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
* Fixes for AcuniaPropertiesTest
@ 2003-03-02 22:06 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2003-03-02 22:06 UTC (permalink / raw)
  To: mauve-discuss

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

Hi,

I just committed the following fixes to the AcuniaPropertiesTest.

2003-03-02  Mark Wielaard  <mark@klomp.org>

   * gnu/testlet/java/util/Properties/AcuniaPropertiesTest.java
   (test_list): Skip -- header line.
   (test_propertyNames): Enumeration of propertyNames() and keys() are
   not necessarily in the same order.
   (test_loadextra): Fix double escaped no\\cat. Add explanations for
   corner cases.

Please check this if you relied on the previous outcome of some of these
tests. Results are now correct for current Classpath/libgcj and checked
against Blackdown-1.4.1-beta.

Cheers,

Mark

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

Index: gnu/testlet/java/util/Properties/AcuniaPropertiesTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/util/Properties/AcuniaPropertiesTest.java,v
retrieving revision 1.2
diff -u -r1.2 AcuniaPropertiesTest.java
--- gnu/testlet/java/util/Properties/AcuniaPropertiesTest.java	20 Jul 2002 01:30:42 -0000	1.2
+++ gnu/testlet/java/util/Properties/AcuniaPropertiesTest.java	2 Mar 2003 21:49:57 -0000
@@ -191,7 +191,8 @@
     start = count;
     while ( ba[count] !='\n' && count < ba.length) { count++;}
     s = new String(ba , start , count - start);
-    th.check(v.contains(s), "v does not contain:$"+s+"$");
+    if (!s.startsWith("--")) // list() adds a header
+	th.check(v.contains(s), "v does not contain:$"+s+"$");
     v.removeElement(s);
     count++;
     }
@@ -229,7 +230,8 @@
     start = count;
     while ( ba[count] !='\n' && count < ba.length) { count++;}
     s = new String(ba , start , count - start);
-    th.check(v.contains(s), "v does not contain:$"+s+"$");
+    if (!s.startsWith("--")) // list() adds a header
+      th.check(v.contains(s), "v does not contain:$"+s+"$");
     v.removeElement(s);
     count++;
     }
@@ -301,10 +303,20 @@
     Enumeration ek = p.keys();
     boolean ok = true;
     Vector v = new Vector();
-    int i=0;
-    while (ek.hasMoreElements() && en.hasMoreElements()) {
-     v.add(ek.nextElement());
-     if (v.elementAt(i++) != en.nextElement()) ok = false; }
+    Enumeration ek2 = p.keys();
+    while (ek2.hasMoreElements()) {
+      v.add(ek2.nextElement ());
+    }
+    while (ek.hasMoreElements() && en.hasMoreElements())
+    {
+     ek.nextElement();
+     Object next = en.nextElement();
+     if (!v.contains(next))
+     {
+       ok = false;
+       th.debug(next + " not in " + v);
+     }
+    }
     th.check(ok , "all elements are the same");
     th.check( ! ek.hasMoreElements() &&  ! en.hasMoreElements() , "make sure both enumerations are empty");
     p = new Properties(defProps);
@@ -500,12 +512,20 @@
   public void test_loadextra(){
     th.checkPoint("load(java.io.InputStream)void");
     Properties p = new Properties();
-    buffer =new String("   !comment\n \t  \nname = no\r    #morec\tomm\\\nents\r\n  dog=no\\cat   \nburps    :\ntest=\ndate today\n\n\nlong\\\n   value=tryin \\\n gto\n4:vier\nvier     :4").getBytes();
+    buffer =new String("   !comment\n \t  \nname = no\r    #morec\tomm\\\nents\r\n  dog=no\\\\cat   \nburps    :\ntest=\ndate today\n\n\nlong\\\n   value=tryin \\\n gto\n4:vier\nvier     :4").getBytes();
     bin = new ByteArrayInputStream(buffer);   	
     try {p.load(bin);} catch (Exception e) {}
     Enumeration e = p.keys();
     Vector v = new Vector();
+    // Yes, the following is valid.
+    // Names can contain a !, just not whitespace,
+    // and only lines starting with comment chars are ignored.
+    v.add("!comment=");
     v.add("name=no");
+    // Yes, the following is valid
+    // Line starts with whitespace, not a comment
+    // and "\\\n" is a line continuation.
+    v.add("#morec=omments");
     v.add("dog=no\\cat   ");
     v.add("burps=");
     v.add("test=");

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

only message in thread, other threads:[~2003-03-02 22:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-02 22:06 Fixes for AcuniaPropertiesTest Mark Wielaard

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).