summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkthoms2009-01-20 03:36:04 (EST)
committerkthoms2009-01-20 03:36:04 (EST)
commitdc29854fcb2d4183daec0e0c96d4b7d942f19231 (patch)
tree2b3d0e351de03ecf347d375542b0b81c912456d3
parent83f5be320eb439530c6fd1a447c8de551d8f298d (diff)
downloadorg.eclipse.xpand-dc29854fcb2d4183daec0e0c96d4b7d942f19231.zip
org.eclipse.xpand-dc29854fcb2d4183daec0e0c96d4b7d942f19231.tar.gz
org.eclipse.xpand-dc29854fcb2d4183daec0e0c96d4b7d942f19231.tar.bz2
Added tests
-rw-r--r--tests/org.eclipse.xpand.tests/src/org/eclipse/xpand/internal/tests/XpandUtilTest.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/org.eclipse.xpand.tests/src/org/eclipse/xpand/internal/tests/XpandUtilTest.java b/tests/org.eclipse.xpand.tests/src/org/eclipse/xpand/internal/tests/XpandUtilTest.java
new file mode 100644
index 0000000..67c64bb
--- /dev/null
+++ b/tests/org.eclipse.xpand.tests/src/org/eclipse/xpand/internal/tests/XpandUtilTest.java
@@ -0,0 +1,39 @@
+package org.eclipse.xpand.internal.tests;
+
+import junit.framework.Assert;
+
+import org.eclipse.xpand2.XpandUtil;
+import org.junit.Test;
+
+public class XpandUtilTest {
+
+ @Test
+ public void testWithoutLastSegment () {
+ final String[][] TEST = {
+ {null, null},
+ {"", null},
+ {"org", null},
+ {"org::eclipse", "org"},
+ {"org::eclipse::xpand2", "org::eclipse"}
+ };
+
+ for (String[] data : TEST) {
+ Assert.assertEquals(data[1], XpandUtil.withoutLastSegment(data[0]));
+ }
+ }
+
+ @Test
+ public void testGetLastSegment () {
+ final String[][] TEST = {
+ {null, null},
+ {"", ""},
+ {"org", "org"},
+ {"org::eclipse", "eclipse"},
+ {"org::eclipse::xpand2", "xpand2"}
+ };
+
+ for (String[] data : TEST) {
+ Assert.assertEquals(data[1], XpandUtil.getLastSegment(data[0]));
+ }
+ }
+}