| 1 |
' This file is part of the LibreOffice project. |
| 2 |
' |
| 3 |
' This Source Code Form is subject to the terms of the Mozilla Public |
| 4 |
' License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 |
' file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 |
' |
| 7 |
|
| 8 |
Option Explicit |
| 9 |
|
| 10 |
Function doUnitTest As String |
| 11 |
TestUtil.Testinit |
| 12 |
verify_testSpace |
| 13 |
doUnitTest = TestUtil.GetResult() |
| 14 |
End Function |
| 15 |
|
| 16 |
Sub verify_testSpace() |
| 17 |
On Error Goto errorHandler |
| 18 |
|
| 19 |
TestUtil.AssertEqual(Space(3), " ", "Space(3)") |
| 20 |
TestUtil.AssertEqual(Space(2), " ", "Space(2)") |
| 21 |
TestUtil.AssertEqual(Space(0), "", "Space(0)") |
| 22 |
|
| 23 |
' Negative values generate an empty string |
| 24 |
TestUtil.AssertEqual(Space(-1), "", "Space(-1)") |
| 25 |
TestUtil.AssertEqual(Space(-4), "", "Space(-4)") |
| 26 |
|
| 27 |
Exit Sub |
| 28 |
errorHandler: |
| 29 |
TestUtil.ReportErrorHandler("verify_testSpace", Err, Error$, Erl) |
| 30 |
End Sub |