forked from KenRoytman/utPLSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathut_str.pkb
executable file
·54 lines (46 loc) · 1.05 KB
/
ut_str.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
CREATE OR REPLACE PACKAGE BODY ut_str
IS
PROCEDURE ut_setup
IS
BEGIN
DBMS_OUTPUT.PUT_LINE ('Ran setup');
END;
PROCEDURE ut_teardown
IS
BEGIN
DBMS_OUTPUT.PUT_LINE ('Ran teardown');
END;
-- For each program to test...
PROCEDURE ut_betwn IS
BEGIN
utAssert.eq (
'Typical Valid Usage',
str.betwn ('this is a string', 3, 7),
'is is'
);
utAssert.eq (
'Null Start',
str.betwn ('this is a string', NULL, 7),
'ing'
);
utAssert.isNULL (
'Start bigger than end',
str.betwn ('this is a string', 3, 1)
);
utAssert.eval (
'Complex expression',
':p1 = :p2 or :p1 like :p2',
'abc',
str.betwn ('abc%efg', 1,4)
);
END ut_betwn;
PROCEDURE ut_betwn2 IS
BEGIN
utAssert.eq (
'Typical Valid Usage',
str.betwn ('this is a string', -2, -6),
'strin'
);
END ut_betwn2;
END ut_str;
/