1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3/********************************************************************
4 * COPYRIGHT:
5 * Copyright (c) 1997-2006, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 ********************************************************************/
8
9/**
10 * G7CollationTest is a third level test class.  This test performs the examples
11 * mentioned on the IBM Java international demos web site.
12 * Sample Rules: & Z < p , P
13 * Effect :  Making P sort after Z.
14 *
15 * Sample Rules: & c < ch , cH, Ch, CH
16 * Effect : As well as adding sequences of characters that act as a single character (this is
17 * known as contraction), you can also add characters that act like a sequence of
18 * characters (this is known as expansion).
19 *
20 * Sample Rules: & Question'-'mark ; '?' & Hash'-'mark ; '#' & Ampersand ; '&'
21 * Effect : Expansion and contraction can actually be combined.
22 *
23 * Sample Rules: & aa ; a'-' & ee ; e'-' & ii ; i'-' & oo ; o'-' & uu ; u'-'
24 * Effect : sorted sequence as the following,
25 * aardvark
26 * a-rdvark
27 * abbot
28 * coop
29 * co-p
30 * cop
31 */
32
33#ifndef _G7COLL
34#define _G7COLL
35
36#include "unicode/utypes.h"
37
38#if !UCONFIG_NO_COLLATION
39
40#include "unicode/tblcoll.h"
41#include "tscoll.h"
42
43class G7CollationTest: public IntlTestCollator {
44public:
45    // If this is too small for the test data, just increase it.
46    // Just don't make it too large, otherwise the executable will get too big
47    enum EToken_Len { MAX_TOKEN_LEN = 16 };
48
49    enum ETotal_Locales { TESTLOCALES = 12 };
50    enum ETotal_Fixed { FIXEDTESTSET = 15 };
51    enum ETotal_Test { TOTALTESTSET = 30 };
52
53    G7CollationTest() {}
54    virtual ~G7CollationTest();
55    void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
56
57
58    // perform test for G7 locales
59    void TestG7Locales(/* char* par */);
60
61    // perform test with added rules " & Z < p, P"
62    void TestDemo1(/* char* par */);
63
64    // perorm test with added rules "& C < ch , cH, Ch, CH"
65    void TestDemo2(/* char* par */);
66
67    // perform test with added rules
68    // "& Question'-'mark ; '?' & Hash'-'mark ; '#' & Ampersand ; '&'"
69    void TestDemo3(/* char* par */);
70
71    // perform test with added rules
72    // " & aa ; a'-' & ee ; e'-' & ii ; i'-' & oo ; o'-' & uu ; u'-' "
73    void TestDemo4(/* char* par */);
74
75};
76
77#endif /* #if !UCONFIG_NO_COLLATION */
78
79#endif
80