2020-12-21 09:00:03 +03:00
|
|
|
'
|
|
|
|
' This file is part of the LibreOffice project.
|
|
|
|
'
|
|
|
|
' This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
' License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
'
|
|
|
|
|
add VBA test cases
tests: ISARRAY, ISDATE, ISEMPTY, ISERROR, ISMISSING,
ISNULL, ISNUMERIC, ISOBJECT, JOIN, LBOUND, LCASE
Change-Id: I0b0dacd0d62bf00680f33866ce7ec0152eec27e0
Reviewed-on: https://gerrit.libreoffice.org/36509
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-13 11:32:29 +02:00
|
|
|
Option VBASupport 1
|
|
|
|
Option Explicit
|
|
|
|
|
|
|
|
Function doUnitTest() As String
|
2020-12-21 09:00:03 +03:00
|
|
|
TestUtil.TestInit
|
|
|
|
verify_testJoin
|
|
|
|
doUnitTest = TestUtil.GetResult()
|
add VBA test cases
tests: ISARRAY, ISDATE, ISEMPTY, ISERROR, ISMISSING,
ISNULL, ISNUMERIC, ISOBJECT, JOIN, LBOUND, LCASE
Change-Id: I0b0dacd0d62bf00680f33866ce7ec0152eec27e0
Reviewed-on: https://gerrit.libreoffice.org/36509
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-13 11:32:29 +02:00
|
|
|
End Function
|
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
Sub verify_testJoin()
|
add VBA test cases
tests: ISARRAY, ISDATE, ISEMPTY, ISERROR, ISMISSING,
ISNULL, ISNUMERIC, ISOBJECT, JOIN, LBOUND, LCASE
Change-Id: I0b0dacd0d62bf00680f33866ce7ec0152eec27e0
Reviewed-on: https://gerrit.libreoffice.org/36509
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-13 11:32:29 +02:00
|
|
|
On Error GoTo errorHandler
|
2020-12-21 09:00:03 +03:00
|
|
|
Dim vaArray(2) As String
|
add VBA test cases
tests: ISARRAY, ISDATE, ISEMPTY, ISERROR, ISMISSING,
ISNULL, ISNUMERIC, ISOBJECT, JOIN, LBOUND, LCASE
Change-Id: I0b0dacd0d62bf00680f33866ce7ec0152eec27e0
Reviewed-on: https://gerrit.libreoffice.org/36509
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-13 11:32:29 +02:00
|
|
|
vaArray(0) = "string1"
|
|
|
|
vaArray(1) = "string2"
|
|
|
|
vaArray(2) = "string3"
|
|
|
|
|
2020-12-21 09:00:03 +03:00
|
|
|
TestUtil.AssertEqual(Join(vaArray), "string1 string2 string3", "Join(vaArray)")
|
|
|
|
TestUtil.AssertEqual(Join(vaArray, " "), "string1 string2 string3", "Join(vaArray, "" "")")
|
|
|
|
TestUtil.AssertEqual(Join(vaArray, "<>"), "string1<>string2<>string3", "Join(vaArray, ""<>"")")
|
|
|
|
TestUtil.AssertEqual(Join(vaArray, ""), "string1string2string3", "Join(vaArray, """")")
|
add VBA test cases
tests: ISARRAY, ISDATE, ISEMPTY, ISERROR, ISMISSING,
ISNULL, ISNUMERIC, ISOBJECT, JOIN, LBOUND, LCASE
Change-Id: I0b0dacd0d62bf00680f33866ce7ec0152eec27e0
Reviewed-on: https://gerrit.libreoffice.org/36509
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-13 11:32:29 +02:00
|
|
|
|
2023-01-18 16:07:09 +00:00
|
|
|
' tdf#141474 keyword names need to match that of VBA
|
|
|
|
Dim aList(0 to 7) As String : aList = Array("(", "Star", "|", "Open", "|", "Libre", ")", "Office")
|
|
|
|
TestUtil.AssertEqual(Join(sourceArray:=aList), "( Star | Open | Libre ) Office", "Join() with 1 keyword name")
|
|
|
|
TestUtil.AssertEqual(Join(delimiter:="", sourceArray:=aList), "(Star|Open|Libre)Office", "Join() with 2 keyword names")
|
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
Exit Sub
|
add VBA test cases
tests: ISARRAY, ISDATE, ISEMPTY, ISERROR, ISMISSING,
ISNULL, ISNUMERIC, ISOBJECT, JOIN, LBOUND, LCASE
Change-Id: I0b0dacd0d62bf00680f33866ce7ec0152eec27e0
Reviewed-on: https://gerrit.libreoffice.org/36509
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-13 11:32:29 +02:00
|
|
|
errorHandler:
|
2020-12-21 09:00:03 +03:00
|
|
|
TestUtil.ReportErrorHandler("verify_testJoin", Err, Error$, Erl)
|
add VBA test cases
tests: ISARRAY, ISDATE, ISEMPTY, ISERROR, ISMISSING,
ISNULL, ISNUMERIC, ISOBJECT, JOIN, LBOUND, LCASE
Change-Id: I0b0dacd0d62bf00680f33866ce7ec0152eec27e0
Reviewed-on: https://gerrit.libreoffice.org/36509
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-13 11:32:29 +02:00
|
|
|
End Sub
|