From: Mark Wielaard <mark@klomp.org>
To: mauve-discuss@sources.redhat.com
Subject: Fixes for AcuniaPropertiesTest
Date: Sun, 02 Mar 2003 22:06:00 -0000 [thread overview]
Message-ID: <1046642767.19771.571.camel@elsschot> (raw)
[-- 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=");
reply other threads:[~2003-03-02 22:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1046642767.19771.571.camel@elsschot \
--to=mark@klomp.org \
--cc=mauve-discuss@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).