From: SVN by r. <sv...@ca...> - 2010-05-08 09:49:00
|
Author: roy Date: 2010-05-08 11:48:51 +0200 (Sat, 08 May 2010) New Revision: 471 Modified: src/test/java/nl/improved/sqlclient/SQLUtilTest.java Log: more test Modified: src/test/java/nl/improved/sqlclient/SQLUtilTest.java =================================================================== --- src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2010-05-07 08:17:22 UTC (rev 470) +++ src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2010-05-08 09:48:51 UTC (rev 471) @@ -554,6 +554,23 @@ assertTrue("Table name should match 'mytable', but was " + matches.get(0), matches.contains("mytable")); } + public void testGetLastBreak() { + String input = "abc def gh ijk"; + String expected = "abc def gh"; + int index = SQLUtil.getLastBreakIndex(input); + assertEquals(expected, input.substring(0, index)); + + input = "abc.def gh.ijk"; + expected = "abc.def gh"; + index = SQLUtil.getLastBreakIndex(input); + assertEquals(expected, input.substring(0, index)); + + input = "abc(def gh(ijk"; + expected = "abc(def gh"; + index = SQLUtil.getLastBreakIndex(input); + assertEquals(expected, input.substring(0, index)); + } + /* public void testTabCompletionInfoDESC() { List<String> sqlCommand = Arrays.asList(new String[]{"DESC "}); Point cursorPos = new Point(sqlCommand.get(0).length(),0); |