Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
DarianDeGraaf authored Jun 16, 2024
1 parent 762b627 commit 18f0065
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions test/test_languages/testFortran.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,6 @@ def test_subroutine(self):
self.assertEqual('test2', result[1].name)
self.assertEqual('test2( )', result[1].long_name)

def test_new_ignore_next(self): #test if ignore_next and token_upper are working as intended
result = get_fortran_function_list('''
% FUNCTION test(a, b)
% REAL :: a
% REAL :: b
% END FUNCTION test
function test2
endfunction test2
''')
self.assertEqual(1, len(result))
self.assertEqual('test2', result[0].name)
self.assertEqual('test2( )', result[0].long_name)

def test_new_block(self): #test if BLOCK and its function 'ignore_if_paren" are working as intended
result = get_fortran_function_list('''
BLOCK (
Expand All @@ -79,6 +66,24 @@ def test_new_block(self): #test if BLOCK and its function
self.assertEqual('test3( )', result[0].long_name)


def test_program(self): #test if program is being parsed correctly
result = get_fortran_function_list('''
program test
interface operator (+)
module procedure concat
end interface
subroutine test2
endsubroutine test2
end test
''')
self.assertEqual(1, len(result))
self.assertEqual('test::test2', result[0].name)
self.assertEqual('test::test2( )', result[0].long_name)
self.assertEqual(1, result[0].top_nesting_level)





def test_module(self):
Expand Down

0 comments on commit 18f0065

Please sign in to comment.