From 5566c16f184a20080238fcc731a4d1f039d9d29c Mon Sep 17 00:00:00 2001 From: LKedward Date: Sat, 5 Jun 2021 14:18:08 +0100 Subject: Add: failing test for module stmt parsing --- test/fpm_test/test_source_parsing.f90 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'test/fpm_test/test_source_parsing.f90') diff --git a/test/fpm_test/test_source_parsing.f90 b/test/fpm_test/test_source_parsing.f90 index 79a4d7a..fb23030 100644 --- a/test/fpm_test/test_source_parsing.f90 +++ b/test/fpm_test/test_source_parsing.f90 @@ -309,7 +309,7 @@ contains open(file=temp_file, newunit=unit) write(unit, '(a)') & - & 'module my_mod', & + & 'module my_mod ! A trailing comment', & & 'use module_one', & & 'interface', & & ' module subroutine f()', & @@ -320,8 +320,17 @@ contains & 'program =1', & & 'program (i) =1', & & 'contains', & - & 'module procedure f()', & - & 'end procedure f', & + & 'module subroutine&', & + & ' e()', & + & 'end subroutine e', & + & 'module subroutine f()', & + & 'end subroutine f', & + & 'module function g()', & + & 'end function g', & + & 'module integer function h()', & + & 'end function h()', & + & 'module real function i()', & + & 'end function i()', & & 'end module test' close(unit) @@ -712,7 +721,7 @@ contains open(file=temp_file, newunit=unit) write(unit, '(a)') & - & 'module :: my_mod', & + & 'module ::my_mod', & & 'end module test' close(unit) @@ -721,8 +730,6 @@ contains return end if - write(*,*) '"',f_source%modules_used(1)%s,'"' - end subroutine test_invalid_module -- cgit v1.2.3 From 4ecf3f3a9ef1c6f6f559389d37281c0fe3d2ce1f Mon Sep 17 00:00:00 2001 From: LKedward Date: Sat, 5 Jun 2021 14:30:28 +0100 Subject: Cleanup test code --- test/fpm_test/test_source_parsing.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/fpm_test/test_source_parsing.f90') diff --git a/test/fpm_test/test_source_parsing.f90 b/test/fpm_test/test_source_parsing.f90 index fb23030..5d69375 100644 --- a/test/fpm_test/test_source_parsing.f90 +++ b/test/fpm_test/test_source_parsing.f90 @@ -328,9 +328,9 @@ contains & 'module function g()', & & 'end function g', & & 'module integer function h()', & - & 'end function h()', & + & 'end function h', & & 'module real function i()', & - & 'end function i()', & + & 'end function i', & & 'end module test' close(unit) -- cgit v1.2.3 From 302782c036fc498dc3739c79fb34a814295f41e5 Mon Sep 17 00:00:00 2001 From: Laurence Kedward Date: Tue, 8 Jun 2021 15:48:53 +0100 Subject: Add: more edge cases for module parsing tests. --- test/fpm_test/test_source_parsing.f90 | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/fpm_test/test_source_parsing.f90') diff --git a/test/fpm_test/test_source_parsing.f90 b/test/fpm_test/test_source_parsing.f90 index 5d69375..12fc419 100644 --- a/test/fpm_test/test_source_parsing.f90 +++ b/test/fpm_test/test_source_parsing.f90 @@ -330,6 +330,10 @@ contains & 'module integer function h()', & & 'end function h', & & 'module real function i()', & + & 'string = " &', & + & 'module name"', & + & 'string = " &', & + & 'module name !"', & & 'end function i', & & 'end module test' close(unit) -- cgit v1.2.3