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 {
|
|
|
|
|
|
|
|
void runIndexedTest(int32_t index, bool_t exec, char* &name,
|
|
|
|
char* par=NULL);
|
|
|
|
#if 0
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestHashtable(void);
|
1999-11-20 01:29:05 +00:00
|
|
|
#endif
|
|
|
|
|
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);
|
|
|
|
|
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,
|
|
|
|
const UnicodeString& summary, bool_t pass,
|
|
|
|
const UnicodeString& expectedResult);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|