diff --git a/source/org/thdl/tib/input/DuffPaneTest.java b/source/org/thdl/tib/input/DuffPaneTest.java index 4d7cdcd..1ce6dbe 100644 --- a/source/org/thdl/tib/input/DuffPaneTest.java +++ b/source/org/thdl/tib/input/DuffPaneTest.java @@ -93,6 +93,13 @@ public class DuffPaneTest extends TestCase { ensureKeysGiveCorrectWylie(in, out); } + private void noExceptions(String keys) { + dp.newDocument(); // initialize to a blank canvas. + fireKeysWithoutModifiers(keys); + // no assertion -- if an exception happens, then and only then + // the test fails. + } + private void ensureKeysGiveCorrectWylie(String keys, String wylie) { dp.newDocument(); // initialize to a blank canvas. fireKeysWithoutModifiers(keys); @@ -803,6 +810,18 @@ public class DuffPaneTest extends TestCase { */ } + public void testNoKeysCrashUs() { + /* why 130? because we want to try some extended ASCII + characters to make sure that they don't crash us either */ + char max = (char)130; + for (char ch = 0; ch < max; ch++) { + noExceptions("" + ch); + for (char ch2 = 0; ch2 < max; ch2++) { + noExceptions("" + ch + ch2); + } + } + } + public void testDisambiguation() { ensureKeysGiveCorrectWylie("gya"); ensureKeysGiveCorrectWylie("g.ya"); diff --git a/source/org/thdl/tib/text/TibetanMachineWeb.java b/source/org/thdl/tib/text/TibetanMachineWeb.java index dc86df4..521597e 100644 --- a/source/org/thdl/tib/text/TibetanMachineWeb.java +++ b/source/org/thdl/tib/text/TibetanMachineWeb.java @@ -212,7 +212,7 @@ public class TibetanMachineWeb implements THDLWylieConstants { /** comma-delimited list of supported punctuation and miscellaneous characters: */ private static final String others - = "_, ,/,|,!,:,;,@,#,$,%,(,),H,M,&,@#,?,=,[,],{,},*,~X,X"; // FIXME: not yet supporting all these... + = "_, ,/,|,!,:,;,@,#,$,%,(,),H,M,&,@#,?,=,{,},*,~X,X"; // FIXME: not yet supporting all these... /** comma-delimited list of supported vowels: */ private static final String vowels