Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / basic / qa / vba_tests / val.vb
blob473f1612309dd4701874c1ec410dca8d0c76c3f8
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_testVal
15 doUnitTest = TestUtil.GetResult()
16 End Function
18 Sub verify_testVal()
19 On Error GoTo errorHandler
21 TestUtil.AssertEqual(Val("02/04/2010"), 2, "Val(""02/04/2010"")")
22 TestUtil.AssertEqual(Val("1050"), 1050, "Val(""1050"")")
23 TestUtil.AssertEqual(Val("130.75"), 130.75, "Val(""130.75"")")
24 TestUtil.AssertEqual(Val("50 Park Lane"), 50, "Val(""50 Park Lane"")")
25 TestUtil.AssertEqual(Val("1320 then some text"), 1320, "Val(""1320 then some text"")")
26 TestUtil.AssertEqual(Val("L13.5"), 0, "Val(""L13.5"")")
27 TestUtil.AssertEqual(Val("sometext"), 0, "Val(""sometext"")")
28 REM tdf#111999
29 REM TestUtil.AssertEqual(Val("1, 2"), 1, "Val(""1, 2"")")
30 TestUtil.AssertEqual(Val("&HFFFF"), -1, "Val(""&HFFFF"")")
32 Exit Sub
33 errorHandler:
34 TestUtil.ReportErrorHandler("verify_testVal", Err, Error$, Erl)
35 End Sub