DuffPane now has the start of a unit test suite. Invoke it via 'ant

clean check'.  Right now there are tests to ensure that typing certain
sequences of keys in the Extended Wylie keyboard gives the expected
Extended Wylie back when "Tools/Convert Tibetan to Wylie" is invoked.

The syntactically illegal d.wa now converts to Tibetan and then back
to d.wa (not dwa, as it did); likewise with the illegal g.wa.  wa
doesn't take any prefixes, but I prefer clean end-to-end
behavior. (jeskd doesn't go end-to-end, though.)

Note that you cannot successfully run the DuffPane tests on a Linux
box unless your DISPLAY variable is set correctly.  Thus, my nightly
builds will fail with an Error (as opposed to a Failure).
This commit is contained in:
dchandler 2003-04-14 05:22:27 +00:00
parent d9b22a43d6
commit efa8fc1f25
8 changed files with 444 additions and 109 deletions

View file

@ -612,10 +612,15 @@ public static boolean isVowel(String s) {
*/
public static boolean isAmbiguousWylie(String x, String y) {
// What about ambiguity between wa-zur and wa? dwa vs. d.wa, e.g.?
// Doesn't matter, because that's illegal. wa doesn't take any
// prefixes.
// Some would say it doesn't matter, because that's illegal. wa
// doesn't take any prefixes. But I want even illegal stuff to
// work well end-to-end (i.e., converting tibetan X to wylie Y to
// tibetan Z should get you X==Z in a perfect world), and it
// doesn't confuse the legal stuff.
return (("g".equals(x) && "y".equals(y))
|| ("g".equals(x) && "w".equals(y))
|| ("d".equals(x) && "w".equals(y))
|| ("b".equals(x) && "l".equals(y))
|| ("b".equals(x) && "r".equals(y)));
}