summaryrefslogtreecommitdiff
path: root/basic/qa/vba_tests/join.vb
diff options
context:
space:
mode:
authorAlain Romedenne <alain.romedenne@libreoffice.org>2023-01-18 16:07:09 +0000
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2023-02-26 16:14:47 +0000
commitfd19bc83cfd49937da8585b9ab938b2086ecf74a (patch)
treefd7fd877c35a173058facad5d6c537f505d5bc7c /basic/qa/vba_tests/join.vb
parent05079016e97d0b41c45cc71695d922fce9ae1e6c (diff)
tdf#141474 tdf#151901 BASIC functions argument names do not match that of VBA
Basic function argument names can be used either by position either by name, keyword arguments ae called 'named arguments' in VBA - VBA doc: https://learn.microsoft.com/en-us/office/vba/language/concepts/getting-started/understanding-named-arguments-and-optional-arguments - libO Basic function signatures: https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03090401.html?DbPAR=BASIC#bm_id3154422 This patch attempts to correct - all in one - malformed keyword names in BASIC function signatures. It reflects keyword arguments usage inside QA BASIC unit tests. In the end Online help pages may incorporate such practice. Change-Id: Iab0c92b2c152d2564662e51e68f1f736b8deefd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145720 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'basic/qa/vba_tests/join.vb')
-rw-r--r--basic/qa/vba_tests/join.vb5
1 files changed, 5 insertions, 0 deletions
diff --git a/basic/qa/vba_tests/join.vb b/basic/qa/vba_tests/join.vb
index c4f568f812e1..8d6dd46dcd65 100644
--- a/basic/qa/vba_tests/join.vb
+++ b/basic/qa/vba_tests/join.vb
@@ -27,6 +27,11 @@ Sub verify_testJoin()
TestUtil.AssertEqual(Join(vaArray, "<>"), "string1<>string2<>string3", "Join(vaArray, ""<>"")")
TestUtil.AssertEqual(Join(vaArray, ""), "string1string2string3", "Join(vaArray, """")")
+ ' 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")
+
Exit Sub
errorHandler:
TestUtil.ReportErrorHandler("verify_testJoin", Err, Error$, Erl)