Moved ad-hoc test.java test cases to UnicodeGraphemeClusterTest.java,
a JUnit test which can be run via 'ant check'. Removed test.java and its build process.
This commit is contained in:
parent
395eca7bb1
commit
16cbfb6033
4 changed files with 53 additions and 25 deletions
23
build.xml
23
build.xml
|
@ -291,12 +291,6 @@
|
|||
<param name="my.included.source.file"
|
||||
value="org/thdl/tib/input/Jskad.java"/>
|
||||
</antcall>
|
||||
<!-- DLC NOW -->
|
||||
<antcall target="our-internal-javac-task">
|
||||
<param name="mybin" value="${jskadbin}"/>
|
||||
<param name="my.included.source.file"
|
||||
value="org/thdl/tib/text/tshegbar/test.java"/>
|
||||
</antcall>
|
||||
<antcall target="our-internal-javac-task">
|
||||
<param name="mybin" value="${jskadbin}"/>
|
||||
<param name="my.included.source.file"
|
||||
|
@ -372,6 +366,11 @@
|
|||
<param name="my.included.source.file"
|
||||
value="org/thdl/tib/text/tshegbar/LegalTshegBarTest.java"/>
|
||||
</antcall>
|
||||
<antcall target="our-internal-javac-task">
|
||||
<param name="mybin" value="${junitbin}"/>
|
||||
<param name="my.included.source.file"
|
||||
value="org/thdl/tib/text/tshegbar/UnicodeGraphemeClusterTest.java"/>
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
<!-- Builds the standalone translation tool: -->
|
||||
|
@ -646,7 +645,6 @@
|
|||
</jar>
|
||||
</target>
|
||||
|
||||
<!-- DLC FIXME: This used to include Jskad2Javascript.class, etc. But it no longer does. Compile those extra files if Edward hasn't removed them! -->
|
||||
<target name="jskad-all-in-one-dist" depends="jskad-compile"
|
||||
description="generates the self-contained binary distribution for Jskad" >
|
||||
<!-- Now put everything in ${jskadbin} and ${ext}/netscape, plus
|
||||
|
@ -771,17 +769,6 @@
|
|||
</java>
|
||||
</target>
|
||||
|
||||
<!-- DLC NOW convert to junit tests. -->
|
||||
<target name="test-tsheg-bar" depends="jskad-dist" description="runs tsheg bar tests">
|
||||
<java classname="org.thdl.tib.text.tshegbar.test" fork="yes">
|
||||
<classpath>
|
||||
<pathelement location="${lib}/Jskad${my.jar.suffix}.jar"/>
|
||||
<path refid="entire.class.path"/>
|
||||
</classpath>
|
||||
<jvmarg value="-Dthdl.debug=${thdl.debug}"/>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<target name="tt-run" depends="tt-standalone-dist" description="runs the standalone translation tool">
|
||||
<java classname="org.thdl.tib.scanner.WindowScannerFilter" fork="yes">
|
||||
<classpath>
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
<test name="org.thdl.util.TrieTest"/>
|
||||
<test name="org.thdl.tib.text.tshegbar.UnicodeUtilsTest"/>
|
||||
<test name="org.thdl.tib.text.tshegbar.LegalTshegBarTest"/>
|
||||
<test name="org.thdl.tib.text.tshegbar.UnicodeGraphemeClusterTest"/>
|
||||
</junit>
|
||||
</target>
|
||||
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
The contents of this file are subject to the THDL Open Community License
|
||||
Version 1.0 (the "License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License on the THDL web site
|
||||
(http://www.thdl.org/).
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
License for the specific terms governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Initial Developer of this software is the Tibetan and Himalayan Digital
|
||||
Library (THDL). Portions created by the THDL are Copyright 2002-2003 THDL.
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s): ______________________________________.
|
||||
*/
|
||||
|
||||
package org.thdl.tib.text.tshegbar;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* @author David Chandler
|
||||
*
|
||||
* Tests {@link org.thdl.tib.text.tshegbar.UnicodeGraphemeCluster} at the unit level.
|
||||
*/
|
||||
public class UnicodeGraphemeClusterTest extends TestCase implements UnicodeConstants {
|
||||
/**
|
||||
* Plain vanilla constructor for UnicodeGraphemeClusterTest.
|
||||
* @param arg0
|
||||
*/
|
||||
public UnicodeGraphemeClusterTest(String arg0) {
|
||||
super(arg0);
|
||||
}
|
||||
/** Invokes a text UI and runs all this class's tests. */
|
||||
public static void main(String[] args) {
|
||||
junit.textui.TestRunner.run(UnicodeGraphemeClusterTest.class);
|
||||
}
|
||||
|
||||
/** Tests the getTopToBottomCodePoints() method and the
|
||||
* UnicodeGraphemeCluster(String) constructor. */
|
||||
public void testGetTopToBottomCodepointsAndMore() {
|
||||
assertTrue(new UnicodeGraphemeCluster("\u0F00").getTopToBottomCodepoints().equals("\u0F7E\u0F7C\u0F68"));
|
||||
assertTrue(new UnicodeGraphemeCluster("\u0F66\u0F93\u0F91\u0FA7\u0F92\u0FAD\u0F77\u0F83\u0F86\u0F84").getTopToBottomCodepoints().equals("\u0F86\u0F83\u0F80\u0F66\u0F92\u0FB7\u0F91\u0FA6\u0FB7\u0F92\u0FB2\u0FAD\u0F71\u0F84"));
|
||||
}
|
||||
}
|
|
@ -26,17 +26,10 @@ import org.thdl.util.ThdlLazyException;
|
|||
* @author David Chandler
|
||||
*/
|
||||
public class test implements UnicodeConstants {
|
||||
public void testTopToBottomForLegalGraphemeClusters() {
|
||||
// DLC delete: System.out.println("see this " + UnicodeUtils.unicodeStringToString(new UnicodeGraphemeCluster("\u0F00").getTopToBottomCodepoints()));
|
||||
ThdlDebug.verify(new UnicodeGraphemeCluster("\u0F00").getTopToBottomCodepoints().equals("\u0F7E\u0F7C\u0F68"));
|
||||
ThdlDebug.verify(new UnicodeGraphemeCluster("\u0F66\u0F93\u0F91\u0FA7\u0F92\u0FAD\u0F77\u0F83\u0F86\u0F84").getTopToBottomCodepoints().equals("\u0F86\u0F83\u0F80\u0F66\u0F92\u0FB7\u0F91\u0FA6\u0FB7\u0F92\u0FB2\u0FAD\u0F71\u0F84"));
|
||||
}
|
||||
|
||||
/** tests this package */
|
||||
public test() throws Throwable {
|
||||
super();
|
||||
|
||||
testTopToBottomForLegalGraphemeClusters();
|
||||
}
|
||||
|
||||
/** Unit tests this package. */
|
||||
|
|
Loading…
Reference in a new issue