2017-01-20 00:20:31 +00:00
|
|
|
// © 2016 and later: Unicode, Inc. and others.
|
2016-06-15 18:58:17 +00:00
|
|
|
// License & terms of use: http://www.unicode.org/copyright.html
|
2012-08-27 20:14:25 +00:00
|
|
|
/*
|
|
|
|
*******************************************************************************
|
|
|
|
*
|
2016-05-31 21:45:07 +00:00
|
|
|
* Copyright (C) 2012-2013, International Business Machines
|
|
|
|
* Corporation and others. All Rights Reserved.
|
2012-08-27 20:14:25 +00:00
|
|
|
*
|
|
|
|
*******************************************************************************
|
|
|
|
* file name: listformattertest.cpp
|
2017-02-03 18:57:23 +00:00
|
|
|
* encoding: UTF-8
|
2012-08-27 20:14:25 +00:00
|
|
|
* tab size: 8 (not used)
|
|
|
|
* indentation:4
|
|
|
|
*
|
|
|
|
* created on: 2012aug27
|
|
|
|
* created by: Umesh P. Nair
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LISTFORMATTERTEST_H__
|
|
|
|
#define __LISTFORMATTERTEST_H__
|
|
|
|
|
|
|
|
#include "unicode/listformatter.h"
|
|
|
|
#include "intltest.h"
|
|
|
|
|
|
|
|
class ListFormatterTest : public IntlTest {
|
|
|
|
public:
|
|
|
|
ListFormatterTest();
|
|
|
|
virtual ~ListFormatterTest() {}
|
|
|
|
|
|
|
|
void runIndexedTest(int32_t index, UBool exec, const char *&name, char *par=0);
|
|
|
|
|
|
|
|
void TestRoot();
|
|
|
|
void TestBogus();
|
|
|
|
void TestEnglish();
|
|
|
|
void TestEnglishUS();
|
|
|
|
void TestRussian();
|
|
|
|
void TestMalayalam();
|
|
|
|
void TestZulu();
|
2012-09-12 00:14:25 +00:00
|
|
|
void TestOutOfOrderPatterns();
|
2013-09-17 18:01:18 +00:00
|
|
|
void Test9946();
|
2012-08-27 20:14:25 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void CheckFormatting(const ListFormatter* formatter, UnicodeString data[], int32_t data_size, const UnicodeString& expected_result);
|
|
|
|
void CheckFourCases(
|
|
|
|
const char* locale_string,
|
|
|
|
UnicodeString one,
|
|
|
|
UnicodeString two,
|
|
|
|
UnicodeString three,
|
|
|
|
UnicodeString four,
|
|
|
|
UnicodeString results[4]);
|
2012-11-15 18:15:37 +00:00
|
|
|
UBool RecordFourCases(
|
|
|
|
const Locale& locale,
|
|
|
|
UnicodeString one,
|
|
|
|
UnicodeString two,
|
|
|
|
UnicodeString three,
|
|
|
|
UnicodeString four,
|
|
|
|
UnicodeString results[4]);
|
2012-08-27 20:14:25 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Reused test data.
|
|
|
|
const UnicodeString prefix;
|
|
|
|
const UnicodeString one;
|
|
|
|
const UnicodeString two;
|
|
|
|
const UnicodeString three;
|
|
|
|
const UnicodeString four;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|