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/.
|
|
|
|
'
|
|
|
|
|
2017-08-03 17:12:21 +02:00
|
|
|
Option VBASupport 1
|
|
|
|
Option Explicit
|
|
|
|
|
|
|
|
Function doUnitTest() As String
|
2020-12-21 09:00:03 +03:00
|
|
|
TestUtil.TestInit
|
2023-01-18 16:07:09 +00:00
|
|
|
verify_String
|
2020-12-21 09:00:03 +03:00
|
|
|
doUnitTest = TestUtil.GetResult()
|
2017-08-03 17:12:21 +02:00
|
|
|
End Function
|
|
|
|
|
2023-01-18 16:07:09 +00:00
|
|
|
Sub verify_String()
|
2017-08-03 17:12:21 +02:00
|
|
|
On Error GoTo errorHandler
|
|
|
|
|
2020-12-21 09:00:03 +03:00
|
|
|
TestUtil.AssertEqual(String(5, "P"), "PPPPP", "String(5, ""P"")")
|
|
|
|
TestUtil.AssertEqual(String(5, "a"), "aaaaa", "String(5, ""a"")")
|
|
|
|
TestUtil.AssertEqual(String(0, "P"), "", "String(0, ""P"")")
|
2017-08-03 17:12:21 +02:00
|
|
|
|
2023-01-18 16:07:09 +00:00
|
|
|
TestUtil.AssertEqual(String(5.8, "à"), "àààààà", "String(5.8, ""à"")")
|
|
|
|
TestUtil.AssertEqual(String(Number:=3.45, Character:="test"), "ttt", "String(Number:=3.45, Character:=""test"")")
|
|
|
|
TestUtil.AssertEqual(String(Character:="☺😎", Number:=7), "☺☺☺☺☺☺☺", "String(Character:=""☺😎"", Number:=7)")
|
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
Exit Sub
|
2017-08-03 17:12:21 +02:00
|
|
|
errorHandler:
|
2023-01-18 16:07:09 +00:00
|
|
|
TestUtil.ReportErrorHandler("verify_String", Err, Error$, Erl)
|
2017-08-03 17:12:21 +02:00
|
|
|
End Sub
|