diff options
author | Chris Goldthorpe | 2009-04-14 20:17:33 +0000 |
---|---|---|
committer | Chris Goldthorpe | 2009-04-14 20:17:33 +0000 |
commit | ad62986c4dfb14aafbd11ddef8c8678b7ef7cc48 (patch) | |
tree | 4d29ced69ded03d431cb32f45e7d90a7b101259c /org.eclipse.ua.tests | |
parent | 426b9860295e1ebc64cdff84e73a4b58d6e76114 (diff) | |
download | eclipse.platform.ua-ad62986c4dfb14aafbd11ddef8c8678b7ef7cc48.tar.gz eclipse.platform.ua-ad62986c4dfb14aafbd11ddef8c8678b7ef7cc48.tar.xz eclipse.platform.ua-ad62986c4dfb14aafbd11ddef8c8678b7ef7cc48.zip |
Add tests for searching for non-ascii characters
Diffstat (limited to 'org.eclipse.ua.tests')
6 files changed, 98 insertions, 0 deletions
diff --git a/org.eclipse.ua.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.ua.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..8d4b9b68e --- /dev/null +++ b/org.eclipse.ua.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +#Tue Apr 14 13:14:47 PDT 2009 +eclipse.preferences.version=1 +encoding//data/help/search/testnl8859.htm=ISO-8859-1 +encoding//data/help/search/testnlUTF8.htm=UTF-8 diff --git a/org.eclipse.ua.tests/data/help/search/testnl8859.htm b/org.eclipse.ua.tests/data/help/search/testnl8859.htm new file mode 100644 index 000000000..081799ac7 --- /dev/null +++ b/org.eclipse.ua.tests/data/help/search/testnl8859.htm @@ -0,0 +1,18 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> +<html> +<head> +<meta http-equiv="Content-Language" content="en-us"> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>ISO 8859-1 doc</title> +</head> +<body> + +This is a test document to search words declared in a document +encoded in ISO-8859-1 + +The test searches for this unique string: + +醙uilaxaxcs + +</body> +</html> diff --git a/org.eclipse.ua.tests/data/help/search/testnlUTF8.htm b/org.eclipse.ua.tests/data/help/search/testnlUTF8.htm new file mode 100644 index 000000000..b5c18da90 --- /dev/null +++ b/org.eclipse.ua.tests/data/help/search/testnlUTF8.htm @@ -0,0 +1,21 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> +<html> +<head> +<meta http-equiv="Content-Language" content="en-us"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<title>UTF-8 doc</title> +</head> +<body> + +This is a test for search within a UTF-8 encoded document + +The test searches for these unique strings: + +acfele贸n + +杈叉泦鏂板勾 + +讗址住职讟职专讜止谞讜止诪职讬指讛) 诇执拽旨讜旨讬 (讬专讞 讗讜 砖诪砖 + +</body> +</html> diff --git a/org.eclipse.ua.tests/data/help/search/toc.xml b/org.eclipse.ua.tests/data/help/search/toc.xml index 134b557cb..27910a1b2 100644 --- a/org.eclipse.ua.tests/data/help/search/toc.xml +++ b/org.eclipse.ua.tests/data/help/search/toc.xml @@ -19,5 +19,9 @@ </topic> <topic href="data/help/search/test_en.html" label="testen.html"> </topic> + <topic href="data/help/search/testnl8859.htm" label="ISO 8859-1 doc"> + </topic> + <topic href="data/help/search/testnlUTF8.htm" label="UTF-8 doc"> + </topic> </topic> </toc> diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AllSearchTests.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AllSearchTests.java index 438fad9f4..7c506abaa 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AllSearchTests.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AllSearchTests.java @@ -35,5 +35,6 @@ public class AllSearchTests extends TestSuite { addTestSuite(LocaleTest.class); addTestSuite(AnalyzerTest.class); addTest(SearchCheatsheet.suite()); + addTest(EncodedCharacterSearch.suite()); } } diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/EncodedCharacterSearch.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/EncodedCharacterSearch.java new file mode 100644 index 000000000..1dd487662 --- /dev/null +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/EncodedCharacterSearch.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.ua.tests.help.search; + + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + + +public class EncodedCharacterSearch extends TestCase { + + /* + * Returns an instance of this Test. + */ + public static Test suite() { + return new TestSuite(EncodedCharacterSearch.class); + } + + public void testIso8859() { + SearchTestUtils.searchOneLocale("\u00E1guilaxaxcs", new String[] {"/org.eclipse.ua.tests/data/help/search/testnl8859.htm" }, "en"); + } + + public void testIso8859AccentNotIgnored() { + SearchTestUtils.searchOneLocale("aguilaxaxcs", new String[0], "en"); + } + + public void testUtf8Accented() { + SearchTestUtils.searchOneLocale("acfele\u00F3n", new String[] {"/org.eclipse.ua.tests/data/help/search/testnlUTF8.htm" }, "en"); + } + + public void testUtf8Chinese() { + SearchTestUtils.searchOneLocale("\u8FB2\u66C6\u65B0\u5E74", new String[] {"/org.eclipse.ua.tests/data/help/search/testnlUTF8.htm" }, "en"); + } + + public void testUtf8Hebrew() { + SearchTestUtils.searchOneLocale("\u05D0\u05B7\u05E1\u05B0\u05D8\u05B0\u05E8\u05D5\u05B9\u05E0\u05D5\u05B9\u05DE" + + "\u05B0\u05D9\u05B8\u05D4) \u05DC\u05B4\u05E7\u05BC\u05D5\u05BC\u05D9 (\u05D9\u05E8\u05D7 \u05D0\u05D5 \u05E9\u05DE\u05E9", new String[] {"/org.eclipse.ua.tests/data/help/search/testnlUTF8.htm" }, "en"); + } + + +} |