1 ' This file is part of the LibreOffice project.
3 ' This Source Code Form is subject to the terms of the Mozilla Public
4 ' License, v. 2.0. If a copy of the MPL was not distributed with this
5 ' file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 Function doUnitTest() As String
12 verify_testTransliteration
13 doUnitTest
= TestUtil
.GetResult()
16 Sub verify_testTransliteration
17 On Error GoTo errorHandler
19 Dim oTr
As Object, s
$, oLoc
as new com
.sun
.star
.lang
.Locale
28 oTr
= CreateUnoService("com.sun.star.i18n.Transliteration")
30 oTr
.LoadModuleByImplName("LOWERCASE_UPPERCASE", oLoc
)
31 TestUtil
.AssertEqual(oTr
.transliterateString2String(s
, 0, Len(s
)), "AB CD. EF. ", "LOWERCASE_UPPERCASE")
33 oTr
.LoadModuleByImplName("UPPERCASE_LOWERCASE", oLoc
)
34 TestUtil
.AssertEqual(oTr
.transliterateString2String(s
, 0, Len(s
)), "ab cd. ef. ", "UPPERCASE_LOWERCASE")
36 oTr
.LoadModuleByImplName("TOGGLE_CASE", oLoc
)
37 TestUtil
.AssertEqual(oTr
.transliterateString2String(s
, 0, Len(s
)), "ab CD. Ef. ", "TOGGLE_CASE")
39 oTr
.LoadModuleByImplName("IGNORE_CASE", oLoc
)
40 TestUtil
.AssertEqual(oTr
.transliterateString2String(s
, 0, Len(s
)), "ab cd. ef. ", "IGNORE_CASE")
42 ' tdf#152520: Without the fix in place, this test would have crashed here
43 oTr
.LoadModuleByImplName("TITLE_CASE", oLoc
)
44 TestUtil
.AssertEqual(oTr
.transliterateString2String(s
, 0, Len(s
)), "Ab cd. ef. ", "TITLE_CASE")
46 oTr
.LoadModuleByImplName("SENTENCE_CASE", oLoc
)
47 TestUtil
.AssertEqual(oTr
.transliterateString2String(s
, 0, Len(s
)), "Ab cd. ef. ", "SENTENCE_CASE")
51 TestUtil
.ReportErrorHandler("verify_testTransliteration", Err
, Error$, Erl
)