2 ' This file is part of the LibreOffice project.
4 ' This Source Code Form is subject to the terms of the Mozilla Public
5 ' License, v. 2.0. If a copy of the MPL was not distributed with this
6 ' file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 Function doUnitTest() As String
15 doUnitTest
= TestUtil
.GetResult()
18 Sub verify_testCollection()
24 Set a
= New Collection
27 a
.Add
3, "Д" ' uppercase Cyrillic script De
28 a
.Add
4, "д" ' lowercase Cyrillic script De
32 Set b
= New Collection
35 b
.Add
3, "ẞ" ' uppercase German Eszett
36 b
.Add
4, "ß" ' lowercase German Eszett
39 On Error GoTo errorHandler
41 ' tdf#144245 - case-insensitive operation for non-ASCII characters
42 ' Without the fix in place, this test would have failed with
45 TestUtil
.AssertEqual(a
.Count
, 2, "a.Count")
47 ' tdf#144245 - case-insensitive operation for non-ASCII item access
48 ' Without the fix in place, this test would have failed with
49 ' - Expected: 1 for d, 3 for lowercase Cyrillic script De (д)
50 ' - Actual : 2 for d, 4 for lowercase Cyrillic script De (д)
51 TestUtil
.AssertEqual(a
.Item("D"), 1, "a.Item(""D"")")
52 TestUtil
.AssertEqual(a
.Item("d"), 1, "a.Item(""d"")")
53 TestUtil
.AssertEqual(a
.Item("Д"), 3, "a.Item(""Д"")")
54 TestUtil
.AssertEqual(a
.Item("д"), 3, "a.Item(""д"")")
56 ' tdf#144245 - German Eszett is uppercased to a two-character 'SS'.
57 ' This test should fail after tdf#110003 has been fixed since the lowercase and the uppercase
58 ' German Eszett should be matched to the same index.
59 ' Before the fix of tdf#110003
60 'TestUtil.AssertEqual(b.Count, 3, "b.Count")
61 ' After the fix of tdf#110003
62 TestUtil
.AssertEqual(b
.Count
, 2, "b.Count")
64 TestUtil
.AssertEqual(b
.Item("SS"), 1, "b.Item(""SS"")")
65 TestUtil
.AssertEqual(b
.Item("ss"), 1, "b.Item(""ss"")")
66 TestUtil
.AssertEqual(b
.Item("ẞ"), 3, "b.Item(""ẞ"")")
67 ' Before the fix of tdf#110003
68 'TestUtil.AssertEqual(b.Item("ß"), 4, "b.Item(""ß"")")
69 ' After the fix of tdf#110003
70 TestUtil
.AssertEqual(b
.Item("ß"), 3, "b.Item(""ß"")")
74 TestUtil
.ReportErrorHandler("verify_testCollection", Err
, Error$, Erl
)