Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2017-02-08 22:31:59 +0000
committerTom Schindl2017-02-08 22:31:59 +0000
commit46c9e630352f400dea4526526b2076171347f626 (patch)
tree1166be12d25d7cd43df651ab795cf8551e63d0c7 /bundles
parentc10c885a6e951bbc281e75840e6a7923b3ec1471 (diff)
downloadorg.eclipse.efxclipse-46c9e630352f400dea4526526b2076171347f626.tar.gz
org.eclipse.efxclipse-46c9e630352f400dea4526526b2076171347f626.tar.xz
org.eclipse.efxclipse-46c9e630352f400dea4526526b2076171347f626.zip
started adding tests for AnnotatedString
Diffstat (limited to 'bundles')
-rw-r--r--bundles/runtime/org.eclipse.fx.core.tests/src/org/eclipse/fx/core/text/TestAnnotatedString.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/bundles/runtime/org.eclipse.fx.core.tests/src/org/eclipse/fx/core/text/TestAnnotatedString.java b/bundles/runtime/org.eclipse.fx.core.tests/src/org/eclipse/fx/core/text/TestAnnotatedString.java
new file mode 100644
index 000000000..d4f019f26
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core.tests/src/org/eclipse/fx/core/text/TestAnnotatedString.java
@@ -0,0 +1,20 @@
+package org.eclipse.fx.core.text;
+
+import org.eclipse.fx.core.text.AnnotatedString.Builder;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestAnnotatedString {
+ @Test
+ public void testAdd_Char() {
+ Builder builder = AnnotatedString.create(10);
+ AnnotatedString string = builder
+ .add(new char [] { 'H','e','l','l','o' }, "a", "b")
+ .add(new char[] { ' ' })
+ .add(new char [] { 'W','o','r','l','d', '!' }, "c", "d")
+ .build();
+ Assert.assertNotNull(string);
+ Assert.assertEquals(12, string.length());
+ Assert.assertEquals("Hello World!", string.toString());
+ }
+}

Back to the top