1999-11-20 01:29:05 +00:00
|
|
|
/*
|
|
|
|
**********************************************************************
|
|
|
|
* Copyright (C) 1999, International Business Machines
|
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
**********************************************************************
|
|
|
|
* Date Name Description
|
|
|
|
* 11/10/99 aliu Creation.
|
|
|
|
**********************************************************************
|
|
|
|
*/
|
|
|
|
#ifndef TRANSTST_H
|
|
|
|
#define TRANSTST_H
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/utypes.h"
|
1999-11-20 01:29:05 +00:00
|
|
|
#include "intltest.h"
|
|
|
|
|
|
|
|
class Transliterator;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
* @summary General test of Transliterator
|
|
|
|
*/
|
|
|
|
class TransliteratorTest : public IntlTest {
|
|
|
|
|
2000-05-18 22:08:39 +00:00
|
|
|
void runIndexedTest(int32_t index, UBool exec, char* &name,
|
1999-11-20 01:29:05 +00:00
|
|
|
char* par=NULL);
|
|
|
|
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestInstantiation(void);
|
1999-11-20 01:29:05 +00:00
|
|
|
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestSimpleRules(void);
|
1999-11-20 01:29:05 +00:00
|
|
|
|
2000-01-13 07:29:20 +00:00
|
|
|
void TestInlineSet(void);
|
|
|
|
|
|
|
|
void TestPatternQuoting(void);
|
|
|
|
|
1999-11-20 01:29:05 +00:00
|
|
|
/**
|
|
|
|
* Create some inverses and confirm that they work. We have to be
|
|
|
|
* careful how we do this, since the inverses will not be true
|
|
|
|
* inverses -- we can't throw any random string at the composition
|
|
|
|
* of the transliterators and expect the identity function. F x
|
|
|
|
* F' != I. However, if we are careful about the input, we will
|
|
|
|
* get the expected results.
|
|
|
|
*/
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestRuleBasedInverse(void);
|
1999-11-20 01:29:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Basic test of keyboard.
|
|
|
|
*/
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestKeyboard(void);
|
1999-11-20 01:29:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Basic test of keyboard with cursor.
|
|
|
|
*/
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestKeyboard2(void);
|
1999-11-20 01:29:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test keyboard transliteration with back-replacement.
|
|
|
|
*/
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestKeyboard3(void);
|
1999-11-20 01:29:05 +00:00
|
|
|
|
|
|
|
void keyboardAux(const Transliterator& t,
|
|
|
|
const char* DATA[], int32_t DATA_length);
|
|
|
|
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestArabic(void);
|
1999-11-20 01:29:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Compose the Kana transliterator forward and reverse and try
|
|
|
|
* some strings that should come out unchanged.
|
|
|
|
*/
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestCompoundKana(void);
|
1999-11-20 01:29:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Compose the hex transliterators forward and reverse.
|
|
|
|
*/
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestCompoundHex(void);
|
1999-11-20 01:29:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Do some basic tests of filtering.
|
|
|
|
*/
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestFiltering(void);
|
1999-11-20 01:29:05 +00:00
|
|
|
|
2000-02-12 01:23:13 +00:00
|
|
|
/**
|
|
|
|
* Regression test for bugs found in Greek transliteration.
|
|
|
|
*/
|
|
|
|
void TestJ277(void);
|
|
|
|
|
2000-03-08 19:26:17 +00:00
|
|
|
/**
|
|
|
|
* Prefix, suffix support in hex transliterators.
|
|
|
|
*/
|
|
|
|
void TestJ243(void);
|
|
|
|
|
2000-03-18 01:42:45 +00:00
|
|
|
/**
|
|
|
|
* Parsers need better syntax error messages.
|
|
|
|
*/
|
|
|
|
void TestJ329(void);
|
|
|
|
|
2000-05-20 04:40:29 +00:00
|
|
|
/**
|
|
|
|
* Test segments and segment references.
|
|
|
|
*/
|
2000-05-24 17:32:49 +00:00
|
|
|
void TestSegments(void);
|
2000-05-20 04:40:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test cursor positioning outside of the key
|
|
|
|
*/
|
2000-05-24 17:32:49 +00:00
|
|
|
void TestCursorOffset(void);
|
2000-05-20 04:40:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test zero length and > 1 char length variable values. Test
|
|
|
|
* use of variable refs in UnicodeSets.
|
|
|
|
*/
|
2000-05-24 17:32:49 +00:00
|
|
|
void TestArbitraryVariableValues(void);
|
2000-05-20 04:40:29 +00:00
|
|
|
|
2000-06-29 22:15:17 +00:00
|
|
|
/**
|
|
|
|
* Confirm that the contextStart, contextLimit, start, and limit
|
|
|
|
* behave correctly. J474.
|
|
|
|
*/
|
|
|
|
void TestPositionHandling(void);
|
|
|
|
|
2000-06-30 00:15:44 +00:00
|
|
|
/**
|
|
|
|
* Test the Hiragana-Katakana transliterator.
|
|
|
|
*/
|
|
|
|
void TestHiraganaKatakana(void);
|
|
|
|
|
2000-06-30 23:26:07 +00:00
|
|
|
/**
|
|
|
|
* Test cloning / copy constructor of RBT.
|
|
|
|
*/
|
|
|
|
void TestCopyJ476(void);
|
2000-06-30 00:15:44 +00:00
|
|
|
|
1999-11-20 01:29:05 +00:00
|
|
|
//======================================================================
|
|
|
|
// Support methods
|
|
|
|
//======================================================================
|
|
|
|
void expect(const UnicodeString& rules,
|
|
|
|
const UnicodeString& source,
|
|
|
|
const UnicodeString& expectedResult);
|
|
|
|
|
|
|
|
void expect(const Transliterator& t,
|
|
|
|
const UnicodeString& source,
|
|
|
|
const UnicodeString& expectedResult,
|
|
|
|
const Transliterator& reverseTransliterator);
|
|
|
|
|
|
|
|
void expect(const Transliterator& t,
|
|
|
|
const UnicodeString& source,
|
|
|
|
const UnicodeString& expectedResult);
|
|
|
|
|
|
|
|
void expectAux(const UnicodeString& tag,
|
|
|
|
const UnicodeString& source,
|
|
|
|
const UnicodeString& result,
|
|
|
|
const UnicodeString& expectedResult);
|
|
|
|
|
|
|
|
void expectAux(const UnicodeString& tag,
|
2000-05-18 22:08:39 +00:00
|
|
|
const UnicodeString& summary, UBool pass,
|
1999-11-20 01:29:05 +00:00
|
|
|
const UnicodeString& expectedResult);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|