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
14 verify_testTypeNameBoolean
15 doUnitTest
= TestUtil
.GetResult()
18 Sub verify_testTypeNameBoolean()
19 On Error GoTo errorHandler
21 TestUtil
.AssertEqual(TypeName(1>2), "Boolean", "TypeName(1>2)")
22 TestUtil
.AssertEqual(TypeName(2.0>1.0), "Boolean", "TypeName(2.0>1.0)")
23 TestUtil
.AssertEqual(TypeName("A">"B"), "Boolean", "TypeName(""A"">""B"")")
25 TestUtil
.AssertEqual(Str(2>1), "True", "Str(2>1)")
26 TestUtil
.AssertEqual(Str(1>2), "False", "Str(1>2)")
28 TestUtil
.AssertEqual(Str(2.0>1.0), "True", "Str(2.0>1.0)")
29 TestUtil
.AssertEqual(Str(1.0>2.0), "False", "Str(1.0>2.0)")
31 TestUtil
.AssertEqual(Str("B">"A"), "True", "Str(""B"">""A"")")
32 TestUtil
.AssertEqual(Str("A">"B"), "False", "Str(""A"">""B"")")
34 ' tdf#145960 - return type of boolean operators should be of type boolean
35 TestUtil
.AssertEqual(TypeName(True Mod
True), "Long", "TypeName(True Mod True)")
36 TestUtil
.AssertEqual(TypeName(True \
True), "Long", "TypeName(True \ True)")
37 TestUtil
.AssertEqual(TypeName(True And True), "Boolean", "TypeName(True And True)")
38 TestUtil
.AssertEqual(TypeName(True Or True), "Boolean", "TypeName(True Or True)")
39 TestUtil
.AssertEqual(TypeName(True Xor
True), "Boolean", "TypeName(True Xor True)")
40 TestUtil
.AssertEqual(TypeName(True Eqv
True), "Boolean", "TypeName(True Eqv True)")
41 TestUtil
.AssertEqual(TypeName(True Imp
True), "Boolean", "TypeName(True Imp True)")
42 TestUtil
.AssertEqual(TypeName(Not True), "Boolean", "TypeName(Not True)")
46 TestUtil
.ReportErrorHandler("verify_testTypeNameBoolean", Err
, Error$, Erl
)