1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /****************************************************************************
5 * Copyright (c) 2001-2008, International Business Machines Corporation and others
7 ***************************************************************************/
12 #include "unicode/utypes.h"
14 #if !UCONFIG_NO_COLLATION
16 #include "unicode/tblcoll.h"
17 #include "unicode/brkiter.h"
19 #include "unicode/usearch.h"
22 typedef struct SearchData SearchData
;
24 class StringSearchTest
: public IntlTest
28 virtual ~StringSearchTest();
30 void runIndexedTest(int32_t index
, UBool exec
, const char* &name
,
32 #if !UCONFIG_NO_BREAK_ITERATION
34 RuleBasedCollator
*m_en_us_
;
35 RuleBasedCollator
*m_fr_fr_
;
36 RuleBasedCollator
*m_de_
;
37 RuleBasedCollator
*m_es_
;
38 BreakIterator
*m_en_wordbreaker_
;
39 BreakIterator
*m_en_characterbreaker_
;
41 RuleBasedCollator
* getCollator(const char *collator
);
42 BreakIterator
* getBreakIterator(const char *breaker
);
43 char * toCharString(const UnicodeString
&text
);
44 Collator::ECollationStrength
getECollationStrength(
45 const UCollationStrength
&strength
) const;
46 UBool
assertEqualWithStringSearch( StringSearch
*strsrch
,
47 const SearchData
*search
);
48 UBool
assertEqual(const SearchData
*search
);
49 UBool
assertCanonicalEqual(const SearchData
*search
);
50 UBool
assertEqualWithAttribute(const SearchData
*search
,
51 USearchAttributeValue canonical
,
52 USearchAttributeValue overlap
);
54 void TestInitialization();
58 #if !UCONFIG_NO_BREAK_ITERATION
59 void TestBreakIterator();
66 void TestCompositeBoundaries();
67 void TestGetSetOffset();
68 void TestGetSetAttribute();
72 void TestSupplementary();
73 void TestContraction();
76 void TestNormCanonical();
77 void TestStrengthCanonical();
78 #if !UCONFIG_NO_BREAK_ITERATION
79 void TestBreakIteratorCanonical();
81 void TestVariableCanonical();
82 void TestOverlapCanonical();
83 void TestCollatorCanonical();
84 void TestPatternCanonical();
85 void TestTextCanonical();
86 void TestCompositeBoundariesCanonical();
87 void TestGetSetOffsetCanonical();
88 void TestSupplementaryCanonical();
89 void TestContractionCanonical();
93 void TestDiacriticMatch();
97 #endif /* #if !UCONFIG_NO_COLLATION */