document RasterOp a little
[LibreOffice.git] / basic / qa / vba_tests / string.vb
blob239141d8173f871b806dd93c0e4b42b4df75c0bf
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/.
9 Option VBASupport 1
10 Option Explicit
12 Function doUnitTest() As String
13 TestUtil.TestInit
14 verify_String
15 doUnitTest = TestUtil.GetResult()
16 End Function
18 Sub verify_String()
19 On Error GoTo errorHandler
21 TestUtil.AssertEqual(String(5, "P"), "PPPPP", "String(5, ""P"")")
22 TestUtil.AssertEqual(String(5, "a"), "aaaaa", "String(5, ""a"")")
23 TestUtil.AssertEqual(String(0, "P"), "", "String(0, ""P"")")
25 TestUtil.AssertEqual(String(5.8, "à"), "àààààà", "String(5.8, ""à"")")
26 TestUtil.AssertEqual(String(Number:=3.45, Character:="test"), "ttt", "String(Number:=3.45, Character:=""test"")")
27 TestUtil.AssertEqual(String(Character:="☺😎", Number:=7), "☺☺☺☺☺☺☺", "String(Character:=""☺😎"", Number:=7)")
29 Exit Sub
30 errorHandler:
31 TestUtil.ReportErrorHandler("verify_String", Err, Error$, Erl)
32 End Sub