-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathtest_betwnstr.pkg
More file actions
51 lines (38 loc) · 1.11 KB
/
test_betwnstr.pkg
File metadata and controls
51 lines (38 loc) · 1.11 KB
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
create or replace package test_betwnstr as
-- %suite(Between string function)
-- %test(Returns substring from start position to end position)
procedure normal_case;
-- %test(Returns substring when start position is zero)
procedure zero_start_position;
-- %test(Returns string until end if end position is greater than string length)
procedure big_end_position;
-- %test(Returns null for null input string value)
procedure null_string;
-- %test(Demo of a disabled test)
-- %disabled
procedure disabled_test;
end;
/
create or replace package body test_betwnstr as
procedure normal_case is
begin
ut.expect( betwnstr( '1234567', 2, 5 ) ).to_equal('2345');
end;
procedure zero_start_position is
begin
ut.expect( betwnstr( '1234567', 0, 5 ) ).to_equal('12345');
end;
procedure big_end_position is
begin
ut.expect( betwnstr( '1234567', 0, 500 ) ).to_equal('1234567');
end;
procedure null_string is
begin
ut.expect( betwnstr( null, 2, 5 ) ).to_be_null;
end;
procedure disabled_test is
begin
ut.expect( betwnstr( null, null, null) ).not_to_be_null;
end;
end;
/