Debian Codegraph @

basic/qa/basic_coverage/test_instr_method.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
12 doUnitTest = "FAIL"
13
14 Dim aString As Variant
15 aString = "Hello"
16 ' InStr
17 If (InStr(1, aString, "l", 1) <> 3) Then Exit Function
18
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
24
25 ' Start position is greater than the length of the string being searched.
26 If (InStr(2, "α", "Α", 1) <> 0) Then Exit Function
27
28 doUnitTest = "OK"
29
30 End Function