Skip to content

Commit 5566c16

Browse files
committed
Add: failing test for module stmt parsing
1 parent 845217f commit 5566c16

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

test/fpm_test/test_source_parsing.f90

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ subroutine test_module(error)
309309

310310
open(file=temp_file, newunit=unit)
311311
write(unit, '(a)') &
312-
& 'module my_mod', &
312+
& 'module my_mod ! A trailing comment', &
313313
& 'use module_one', &
314314
& 'interface', &
315315
& ' module subroutine f()', &
@@ -320,8 +320,17 @@ subroutine test_module(error)
320320
& 'program =1', &
321321
& 'program (i) =1', &
322322
& 'contains', &
323-
& 'module procedure f()', &
324-
& 'end procedure f', &
323+
& 'module subroutine&', &
324+
& ' e()', &
325+
& 'end subroutine e', &
326+
& 'module subroutine f()', &
327+
& 'end subroutine f', &
328+
& 'module function g()', &
329+
& 'end function g', &
330+
& 'module integer function h()', &
331+
& 'end function h()', &
332+
& 'module real function i()', &
333+
& 'end function i()', &
325334
& 'end module test'
326335
close(unit)
327336

@@ -712,7 +721,7 @@ subroutine test_invalid_module(error)
712721

713722
open(file=temp_file, newunit=unit)
714723
write(unit, '(a)') &
715-
& 'module :: my_mod', &
724+
& 'module ::my_mod', &
716725
& 'end module test'
717726
close(unit)
718727

@@ -721,8 +730,6 @@ subroutine test_invalid_module(error)
721730
return
722731
end if
723732

724-
write(*,*) '"',f_source%modules_used(1)%s,'"'
725-
726733
end subroutine test_invalid_module
727734

728735

0 commit comments

Comments
 (0)