forked from KenRoytman/utPLSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathut_betwnstr_failures.pkb
executable file
·79 lines (70 loc) · 1.46 KB
/
ut_betwnstr_failures.pkb
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
CREATE OR REPLACE PACKAGE BODY ut_betwnstr
IS
PROCEDURE ut_setup
IS
BEGIN
NULL;
END;
PROCEDURE ut_teardown
IS
BEGIN
NULL;
END;
-- For each program to test...
PROCEDURE ut_BETWNSTR IS
BEGIN
utAssert.eq (
'Typical valid usage',
BETWNSTR(
STRING_IN => 'abcdefg'
,
START_IN => 3
,
END_IN => 4
),
'cde'
);
utAssert.isnull (
'NULL start',
BETWNSTR(
STRING_IN => 'abcdefg'
,
START_IN => 1
,
END_IN => 5
)
);
utAssert.isnull (
'NULL end',
BETWNSTR(
STRING_IN => 'abcdefg'
,
START_IN => 2
,
END_IN => NULL
)
);
utAssert.isnull (
'End smaller than start',
BETWNSTR(
STRING_IN => 'abcdefg'
,
START_IN => 5
,
END_IN => 5
)
);
utAssert.eq (
'End larger than string length',
BETWNSTR(
STRING_IN => 'abcdefg'
,
START_IN => 3
,
END_IN => 200
),
'cdefg'
);
END ut_BETWNSTR;
END ut_betwnstr;
/