tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / basic / qa / basic_coverage / test_like.bas
blob2d018bf64f010e66fcc28cd748ce98087cbd2b1a
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/.
9 Option Explicit
11 Function doUnitTest() As String
12 TestUtil.TestInit
13 verify_testLike
14 doUnitTest = TestUtil.GetResult()
15 End Function
17 Sub verify_testLike()
18 On Error GoTo errorHandler
19 ' Negation test
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")
38 Exit Sub
39 errorHandler:
40 TestUtil.ReportErrorHandler("verify_testLike", Err, Error$, Erl)
41 End Sub