Skip to content

Commit fd6a1a5

Browse files
committed
Update test.f90
Updated tests for new features/functions.
1 parent 186f048 commit fd6a1a5

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

test/test.f90

+14-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ program test
77
logical :: l1
88

99
c1="My name is Tony Stark. Tony Stark is Iron Man."
10-
!print *,"MYSTRING = ",c1
1110
i1=str_count(c1,"Tony")
12-
!print *,"COUNT OF SPACES = ",i1
11+
if(i1.ne.2)call exit(1)
12+
i1=str_count(c1,"Tony",match_case=.true.)
13+
if(i1.ne.2)call exit(1)
14+
i1=str_count(c1,"TONY",match_case=.false.)
15+
if(i1.ne.2)call exit(1)
16+
i1=str_count(c1,"tony",match_case=.true.)
17+
if(i1.ne.0)call exit(1)
1318

1419
c1=str_replace(c1,"Tony Stark","Steve Rogers")
1520
!print *,"MYSTRING = ",c1
@@ -68,5 +73,12 @@ program test
6873
l1=str_test(c1,"Vision") ! FALSE
6974
!print *,l1
7075
if(l1)call exit(1)
76+
l1=str_test(c1,"THOR",match_case=.true.) ! False
77+
if(l1)call exit(1)
78+
l1=str_test(c1,"THOR",match_case=.false.) ! True
79+
if(.not.l1)call exit(1)
80+
81+
c1="Ironman,Thor,Thanos,Black Panther,Winter Soldier"
82+
if(str_swapcase(str_swapcase(c1)).ne.c1)call exit(1)
7183

7284
end program test

0 commit comments

Comments
 (0)