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/.
11 Function doUnitTest() As String
14 doUnitTest
= TestUtil
.GetResult()
18 On Error GoTo errorHandler
20 TestUtil
.AssertEqual("!" Like
"[.!?]", True, "Negation1")
21 TestUtil
.AssertEqual("a" Like
"[!abc]", False, "Negation2")
22 TestUtil
.AssertEqual("!" Like
"[!!?]", False, "Negation3")
23 TestUtil
.AssertEqual("^" Like
"[.!?]", False, "Negation4")
24 TestUtil
.AssertEqual("^" Like
"[.^?]", True, "Negation5")
25 ' Like test from microsoft vba
26 TestUtil
.AssertEqual("aBBBa" Like
"a*a", True, "Like1")
27 TestUtil
.AssertEqual("F" Like
"[A-Z]", True, "Like2")
28 TestUtil
.AssertEqual("F" Like
"[!A-Z]", False, "Like3")
29 TestUtil
.AssertEqual("a2a" Like
"a#a", True, "Like4")
30 TestUtil
.AssertEqual("aM5b" Like
"a[L-P]#[!c-e]", True, "Like5")
31 TestUtil
.AssertEqual("BAT123khg" Like
"B?T*", True, "Like6")
32 TestUtil
.AssertEqual("CAT123khg" Like
"B?T*", False, "Like7")
33 TestUtil
.AssertEqual("ab" Like
"a*b", True, "Like8")
34 TestUtil
.AssertEqual("a*b" Like
"a [*]b", False, "Like9")
35 TestUtil
.AssertEqual("axxxxxb" Like
"a [*]b", False, "Like10")
36 TestUtil
.AssertEqual("a [xyz" Like
"a [[]*", True, "Like11")
40 TestUtil
.ReportErrorHandler("verify_testLike", Err
, Error$, Erl
)