Skip to content

Commit b91f1d0

Browse files
committed
one more test
1 parent ea2ee73 commit b91f1d0

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

test/fpm_test/test_filesystem.f90

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,10 @@ subroutine test_split_lines_first_last(error)
299299
!> Error handling
300300
type(error_t), allocatable, intent(out) :: error
301301

302-
character, parameter :: CR = achar(13)
303-
character, parameter :: LF = new_line('A')
304-
integer, allocatable :: first(:), last(:)
302+
character, parameter :: CR = achar(13)
303+
character, parameter :: LF = new_line('A')
304+
character(*), parameter :: CRLF = CR//LF
305+
integer, allocatable :: first(:), last(:)
305306

306307
call split_lines_first_last(CR//LF//'line1'//CR//'line2'//LF//'line3'//CR//LF//'hello', first, last)
307308
if (.not.(all(first==[3,9,15,22]) .and. all(last==[7,13,19,26]))) then
@@ -332,6 +333,17 @@ subroutine test_split_lines_first_last(error)
332333
call test_failed(error, "Test split_lines_first_last #5 failed")
333334
return
334335
end if
336+
337+
call split_lines_first_last('build.f90'//CRLF//&
338+
'dependency.f90'//CRLF//&
339+
'example.f90'//CRLF//&
340+
'executable.f90'//CRLF//&
341+
'fortran.f90'//CRLF, first, last))
342+
343+
if (.not.(all(first == [1,12,28,41,57]) .and. all(last == [9,25,38,54,67]))) then
344+
call test_failed(error, "Test split_lines_first_last #6 failed")
345+
return
346+
end if
335347

336348
end subroutine test_split_lines_first_last
337349

0 commit comments

Comments
 (0)