Skip to content

Commit 489aa80

Browse files
committed
fix(string_test): make internal file a variable
1 parent eae1678 commit 489aa80

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/string_test.F90

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,17 +243,20 @@ function constructs_from_real() result(passed)
243243
logical passed
244244
real, parameter :: real_value = -1./1024. ! use a negative power of 2 an exactly representable rational number
245245
real read_value
246+
character(len=:), allocatable :: character_representation
246247

247248
#ifndef _CRAYFTN
248249
associate(string => string_t(real_value))
249-
read(string%string(), *) read_value
250+
character_representation = string%string()
251+
read(character_representation, *) read_value
250252
passed = read_value == real_value
251253
end associate
252254
#else
253255
block
254256
type(string_t) string
255257
string = string_t(real_value)
256-
read(string%string(), *) read_value
258+
character_representation = string%string()
259+
read(character_representation, *) read_value
257260
passed = read_value == real_value
258261
end block
259262
#endif

0 commit comments

Comments
 (0)