diff options
author | LibreOfficiant <LibreOfficiant@sfr.fr> | 2019-11-27 18:48:02 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-11-29 05:55:22 +0100 |
commit | 1dd1b76bc1c6ca249bd2b3c605de642f0761072d (patch) | |
tree | 66e91d3d0b8be6301352a9c4975215af2a37100a | |
parent | 0c4736a3e6b6e641579f517cf134ce2fd89fe132 (diff) |
tdf#128655 LibO Basic For loops variations
2 variations of FOR loops exist. 1st form is missing in local/online
help. This test case seems necessary prior to update help doc.
Change-Id: Ic4ba8a7dc0e1ce5ad1e62dfcf2ce570016f7e117
Reviewed-on: https://gerrit.libreoffice.org/83931
Reviewed-by: LibreOfficiant <LibreOfficiant@sfr.fr>
Reviewed-by: <andreas.heinisch@yahoo.de>
Reviewed-by: himajin100000 <himajin100000@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | core/basic/qa/basic_coverage/test_For_loops.vb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/core/basic/qa/basic_coverage/test_For_loops.vb b/core/basic/qa/basic_coverage/test_For_loops.vb new file mode 100644 index 000000000000..2bd4e432cab6 --- /dev/null +++ b/core/basic/qa/basic_coverage/test_For_loops.vb @@ -0,0 +1,28 @@ +' +' This file is part of the LibreOffice project. +' +' This Source Code Form is subject to the terms of the Mozilla Public +' License, v. 2.0. If a copy of the MPL was not distributed with this +' file, You can obtain one at http://mozilla.org/MPL/2.0/. +' + +Function doUnitTest + Dim s1 As Integer, s2 As Integer, value As Integer + + ' FOR EACH + numbers = Array(3,4,5,6,7,8,9,10,11) + For Each value in numbers + s1 = s1 + value + Next value + + ' FOR .. TO .. STEP .. + For value = 5 To 21 Step 3 + s2 = s2 + value + Next value + + If s1<>9*7 Or s2<>3*25 Then + doUnitTest = 0 + Else + doUnitTest = 1 'Ok + End If +End Function
\ No newline at end of file |