This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
FYI: AttributedCharacterIterator - new tests
- From: David Gilbert <david dot gilbert at object-refinery dot com>
- To: mauve-patches <mauve-patches at sources dot redhat dot com>
- Date: Mon, 11 Sep 2006 15:18:58 +0100
- Subject: FYI: AttributedCharacterIterator - new tests
This patch (committed) adds some new tests for the
AttributedCharacterIterator:
2006-09-11 David Gilbert <david.gilbert@object-refinery.com>
* gnu/testlet/java/text/AttributedCharacterIterator/getRunLimit.java
(test1): Added checks,
*
gnu/testlet/java/text/AttributedCharacterIterator/Attribute/toString.java:
New test.
I've already committed a patch to GNU Classpath CVS to fix the failing
checks.
Regards,
Dave
Index: gnu/testlet/java/text/AttributedCharacterIterator/getRunLimit.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/text/AttributedCharacterIterator/getRunLimit.java,v
retrieving revision 1.1
diff -u -r1.1 getRunLimit.java
--- gnu/testlet/java/text/AttributedCharacterIterator/getRunLimit.java 11 Sep 2006 11:24:51 -0000 1.1
+++ gnu/testlet/java/text/AttributedCharacterIterator/getRunLimit.java 11 Sep 2006 14:14:17 -0000
@@ -49,11 +49,16 @@
AttributedString as = new AttributedString("ABCDEFGHIJ");
as.addAttribute(TextAttribute.LANGUAGE, "English");
as.addAttribute(TextAttribute.FOREGROUND, Color.red, 2, 4);
+ as.addAttribute(TextAttribute.BACKGROUND, Color.blue, 7, 8);
AttributedCharacterIterator aci = as.getIterator();
harness.check(aci.getRunLimit(), 2);
aci.setIndex(2);
harness.check(aci.getRunLimit(), 4);
aci.setIndex(5);
+ harness.check(aci.getRunLimit(), 7);
+ aci.setIndex(7);
+ harness.check(aci.getRunLimit(), 8);
+ aci.setIndex(8);
harness.check(aci.getRunLimit(), 10);
// try an empty string
Index: gnu/testlet/java/text/AttributedCharacterIterator/Attribute/toString.java
===================================================================
RCS file: gnu/testlet/java/text/AttributedCharacterIterator/Attribute/toString.java
diff -N gnu/testlet/java/text/AttributedCharacterIterator/Attribute/toString.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/java/text/AttributedCharacterIterator/Attribute/toString.java 11 Sep 2006 14:14:17 -0000
@@ -0,0 +1,42 @@
+/* toString.java -- some checks for the toString() method.
+ Copyright (C) 2006 David Gilbert <david.gilbert@object-refinery.com>
+This file is part of Mauve.
+
+Mauve is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+Mauve is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Mauve; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: 1.2
+
+package gnu.testlet.java.text.AttributedCharacterIterator.Attribute;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import java.text.AttributedCharacterIterator;
+
+public class toString implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ harness.check(AttributedCharacterIterator.Attribute.INPUT_METHOD_SEGMENT.toString(),
+ "java.text.AttributedCharacterIterator$Attribute(input_method_segment)");
+ harness.check(AttributedCharacterIterator.Attribute.LANGUAGE.toString(),
+ "java.text.AttributedCharacterIterator$Attribute(language)");
+ harness.check(AttributedCharacterIterator.Attribute.READING.toString(),
+ "java.text.AttributedCharacterIterator$Attribute(reading)");
+ }
+}