Debian Codegraph @

basic/qa/basic_coverage/test_converttofromurl_methods.bas

raw
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_testConvertToFromUrl
13 doUnitTest = TestUtil.GetResult()
14 End Function
15
16 Sub verify_testConvertToFromUrl
17 On Error GoTo errorHandler
18
19 TestUtil.AssertEqual( ConvertToUrl( ConvertFromUrl("") ), "", "ConvertToUrl( ConvertFromUrl("") )")
20
21 ' tdf#152917: Without the fix in place, this test would have failed with
22 ' Failed: ConvertFromUrl("file:///foo/bar/test.txt") returned , expected /foo/bar/test.txt
23 If (GetGUIType() <> 1) Then
24 'Linux
25 TestUtil.AssertEqual( ConvertFromUrl("file:///foo/bar/test.txt"), "/foo/bar/test.txt", "ConvertFromUrl(""file:///foo/bar/test.txt"")")
26 Else
27 'Windows
28 TestUtil.AssertEqual( ConvertFromUrl("file://foo/bar/test.txt"), "\\foo\bar\test.txt", "ConvertFromUrl(""file://foo/bar/test.txt"")")
29 End If
30
31 Exit Sub
32 errorHandler:
33 TestUtil.ReportErrorHandler("verify_testConvertToFromUrl", Err, Error$, Erl)
34 End Sub