diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2024-05-14 01:42:22 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2024-05-14 01:42:22 +0000 |
commit | 1c8a93bf9e0bac22ba14f3f50c1299e82f79b1e2 (patch) | |
tree | 0a613b8544af2888d4cfcbbce8a58269a4d1b5f0 /src/test/java/com/healthmarketscience | |
parent | 0bacfe48446d629d43d0d735c5c9583b877f60d5 (diff) | |
download | jackcess-1c8a93bf9e0bac22ba14f3f50c1299e82f79b1e2.tar.gz jackcess-1c8a93bf9e0bac22ba14f3f50c1299e82f79b1e2.zip |
Add support for surrogate pairs in text indexes (e.g. emoticons), fixes #157
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1413 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/test/java/com/healthmarketscience')
3 files changed, 24 insertions, 4 deletions
diff --git a/src/test/java/com/healthmarketscience/jackcess/TestUtil.java b/src/test/java/com/healthmarketscience/jackcess/TestUtil.java index fae1fa0..7626ee4 100644 --- a/src/test/java/com/healthmarketscience/jackcess/TestUtil.java +++ b/src/test/java/com/healthmarketscience/jackcess/TestUtil.java @@ -361,16 +361,25 @@ public class TestUtil } static void dumpIndex(Index index) throws Exception { - dumpIndex(index, new PrintWriter(System.out, true)); + dumpIndex(index, Integer.MAX_VALUE); } - static void dumpIndex(Index index, PrintWriter writer) throws Exception { + static void dumpIndex(Index index, int limit) throws Exception { + dumpIndex(index, new PrintWriter(System.out, true), limit); + } + + static void dumpIndex(Index index, PrintWriter writer, int limit) + throws Exception { writer.println("INDEX: " + index); IndexData.EntryCursor ec = ((IndexImpl)index).cursor(); IndexData.Entry lastE = ec.getLastEntry(); IndexData.Entry e = null; + int count = 0; while((e = ec.getNextEntry()) != lastE) { writer.println(e); + if((count++) > limit) { + break; + } } } diff --git a/src/test/java/com/healthmarketscience/jackcess/impl/IndexCodesTest.java b/src/test/java/com/healthmarketscience/jackcess/impl/IndexCodesTest.java index cfcca83..ce4bb52 100644 --- a/src/test/java/com/healthmarketscience/jackcess/impl/IndexCodesTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/impl/IndexCodesTest.java @@ -64,7 +64,17 @@ public class IndexCodesTest extends TestCase { public void testIndexCodes() throws Exception { - for (final TestDB testDB : TestDB.getSupportedForBasename(Basename.INDEX_CODES, true)) { + doTestDb(Basename.INDEX_CODES); + } + + public void testEmoticons() throws Exception + { + doTestDb(Basename.EMOTICONS); + } + + private static void doTestDb(Basename dbBaseName) throws Exception + { + for (final TestDB testDB : TestDB.getSupportedForBasename(dbBaseName, true)) { Database db = openMem(testDB); db.setDateTimeType(DateTimeType.DATE); diff --git a/src/test/java/com/healthmarketscience/jackcess/impl/JetFormatTest.java b/src/test/java/com/healthmarketscience/jackcess/impl/JetFormatTest.java index 0f6c889..2379891 100644 --- a/src/test/java/com/healthmarketscience/jackcess/impl/JetFormatTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/impl/JetFormatTest.java @@ -58,7 +58,8 @@ public class JetFormatTest extends TestCase { CALC_FIELD("calcFieldTest"), BINARY_INDEX("binIdxTest"), OLD_DATES("oldDates"), - EXT_DATE("extDateTest"); + EXT_DATE("extDateTest"), + EMOTICONS("testEmoticons"); private final String _basename; |