-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.bas
More file actions
33 lines (26 loc) · 719 Bytes
/
example.bas
File metadata and controls
33 lines (26 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
' Include fbtesting.bas or fbtesting.bi.
#include "fbtesting.bas"
using fbtesting
' Create a test runner.
dim tester as Testing = Testing("Test Example")
' Create a test case.
sub mytest(byref t as Testing)
dim result as integer = 1 + 1
if result <> 2 then
' Use t.Error to report failure.
t.Error("Test failed.")
end if
end sub
' Register the test case.
tester.Test(@mytest, "Test Case")
' Test case can be skipped with t.Skip.
sub skipped(byref t as Testing)
t.Skip()
' t.Error after t.Skip will be ignored.
t.Error("Test failed.")
end sub
tester.Test(@skipped, "Skipped Test Case")
' Run tests
tester.Run()
' Use non-zero return value if tests fail.
if tester.Failed() then end 1