LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / basic / qa / basic_coverage / test_instr_method.bas
blob9e4545bb3b44770b75016735adfcce9c6368f9c1
1 ' This file is part of the LibreOffice project.
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/.
8 Option Explicit
10 Function doUnitTest as String
12 doUnitTest = "FAIL"
14 Dim aString As Variant
15 aString = "Hello"
16 ' InStr
17 If (InStr(1, aString, "l", 1) <> 3) Then Exit Function
19 ' tdf#139840 - case-insensitive operation for non-ASCII characters
20 If (InStr(1, "α", "Α", 1) <> 1) Then Exit Function
21 ' tdf#139840 - German Eszett is uppercased to a two-character 'SS'.
22 ' This test should fail after tdf#110003 has been fixed.
23 If (InStr(2, "Straße", "s", 1) <> 5) Then Exit Function
25 ' Start position is greater than the length of the string being searched.
26 If (InStr(2, "α", "Α", 1) <> 0) Then Exit Function
28 doUnitTest = "OK"
30 End Function