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()
19 On Error GoTo errorHandler
20 Dim vaArray(2) As String
21 vaArray(0) = "string1"
22 vaArray(1) = "string2"
23 vaArray(2) = "string3"
25 TestUtil
.AssertEqual(Join(vaArray
), "string1 string2 string3", "Join(vaArray)")
26 TestUtil
.AssertEqual(Join(vaArray
, " "), "string1 string2 string3", "Join(vaArray, "" "")")
27 TestUtil
.AssertEqual(Join(vaArray
, "<>"), "string1<>string2<>string3", "Join(vaArray, ""<>"")")
28 TestUtil
.AssertEqual(Join(vaArray
, ""), "string1string2string3", "Join(vaArray, """")")
30 ' tdf#141474 keyword names need to match that of VBA
31 Dim aList(0 to 7) As String : aList
= Array("(", "Star", "|", "Open", "|", "Libre", ")", "Office")
32 TestUtil
.AssertEqual(Join(sourceArray
:=aList
), "( Star | Open | Libre ) Office", "Join() with 1 keyword name")
33 TestUtil
.AssertEqual(Join(delimiter
:="", sourceArray
:=aList
), "(Star|Open|Libre)Office", "Join() with 2 keyword names")
37 TestUtil
.ReportErrorHandler("verify_testJoin", Err
, Error$, Erl
)