Skip to content

Commit

Permalink
fix(string_test): make internal file a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rouson committed Feb 11, 2024
1 parent eae1678 commit 489aa80
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/string_test.F90
Original file line number Diff line number Diff line change
Expand Up @@ -243,17 +243,20 @@ function constructs_from_real() result(passed)
logical passed
real, parameter :: real_value = -1./1024. ! use a negative power of 2 an exactly representable rational number
real read_value
character(len=:), allocatable :: character_representation

#ifndef _CRAYFTN
associate(string => string_t(real_value))
read(string%string(), *) read_value
character_representation = string%string()
read(character_representation, *) read_value
passed = read_value == real_value
end associate
#else
block
type(string_t) string
string = string_t(real_value)
read(string%string(), *) read_value
character_representation = string%string()
read(character_representation, *) read_value
passed = read_value == real_value
end block
#endif
Expand Down

0 comments on commit 489aa80

Please sign in to comment.