@@ -36,11 +36,11 @@ subroutine test_to_string_complex
36
36
& " Default formatter for complex number" , partial= .true. )
37
37
call check_formatter(to_string((1 , 1 ), ' (F6.2)' ), " ( 1.00, 1.00)" , &
38
38
& " Formatter for complex number" )
39
- call check_formatter(to_string((- 1 , - 1 ), ' ( F6.2) ' ), " ( -1.00, -1.00)" , &
39
+ call check_formatter(to_string((- 1 , - 1 ), ' F6.2' ), " ( -1.00, -1.00)" , &
40
40
& " Formatter for negative complex number" )
41
- call check_formatter(to_string((1 , 1 ), ' ( SP,F6.2) ' ), " ( +1.00, +1.00)" , &
41
+ call check_formatter(to_string((1 , 1 ), ' SP,F6.2' ), " ( +1.00, +1.00)" , &
42
42
& " Formatter with sign control descriptor for complex number" )
43
- call check_formatter(to_string((1 , 1 ), ' ( F6.2) ' ) // to_string((2 , 2 ), ' (F7.3)' ), &
43
+ call check_formatter(to_string((1 , 1 ), ' F6.2' ) // to_string((2 , 2 ), ' (F7.3)' ), &
44
44
& " ( 1.00, 1.00)( 2.000, 2.000)" , &
45
45
& " Multiple formatters for complex numbers" )
46
46
@@ -49,51 +49,51 @@ end subroutine test_to_string_complex
49
49
subroutine test_to_string_integer
50
50
call check_formatter(to_string(100 ), " 100" , &
51
51
& " Default formatter for integer number" )
52
- call check_formatter(to_string(100 , ' (I6) ' ), " 100" , &
52
+ call check_formatter(to_string(100 , ' I6 ' ), " 100" , &
53
53
& " Formatter for integer number" )
54
- call check_formatter(to_string(100 , ' ( I0.6) ' ), " 000100" , &
54
+ call check_formatter(to_string(100 , ' I0.6' ), " 000100" , &
55
55
& " Formatter with zero padding for integer number" )
56
- call check_formatter(to_string(100 , ' (I6) ' ) // to_string(1000 , ' (I7)' ), &
56
+ call check_formatter(to_string(100 , ' I6 ' ) // to_string(1000 , ' (I7)' ), &
57
57
& " 100 1000" , " Multiple formatters for integers" )
58
- call check_formatter(to_string(34 , ' (B8) ' ), " 100010" , &
58
+ call check_formatter(to_string(34 , ' B8 ' ), " 100010" , &
59
59
& " Binary formatter for integer number" )
60
- call check_formatter(to_string(34 , ' ( O0.3) ' ), " 042" , &
60
+ call check_formatter(to_string(34 , ' O0.3' ), " 042" , &
61
61
& " Octal formatter with zero padding for integer number" )
62
- call check_formatter(to_string(34 , ' (Z3) ' ), " 22" , &
62
+ call check_formatter(to_string(34 , ' Z3 ' ), " 22" , &
63
63
& " Hexadecimal formatter for integer number" )
64
64
65
65
end subroutine test_to_string_integer
66
66
67
67
subroutine test_to_string_real
68
68
call check_formatter(to_string(100 .), " 100.0" , &
69
69
& " Default formatter for real number" , partial= .true. )
70
- call check_formatter(to_string(100 ., ' ( F6.2) ' ), " 100.00" , &
70
+ call check_formatter(to_string(100 ., ' F6.2' ), " 100.00" , &
71
71
& " Formatter for real number" )
72
- call check_formatter(to_string(289 ., ' ( E7.2) ' ), " .29E+03" , &
72
+ call check_formatter(to_string(289 ., ' E7.2' ), " .29E+03" , &
73
73
& " Exponential formatter with rounding for real number" )
74
- call check_formatter(to_string(128 ., ' ( ES8.2) ' ), " 1.28E+02" , &
74
+ call check_formatter(to_string(128 ., ' ES8.2' ), " 1.28E+02" , &
75
75
& " Exponential formatter for real number" )
76
76
77
77
! Wrong demonstration
78
- call check_formatter(to_string(- 100 ., ' ( F6.2) ' ), " *" , &
78
+ call check_formatter(to_string(- 100 ., ' F6.2' ), " *" , &
79
79
& " Too narrow formatter for signed real number" , partial= .true. )
80
- call check_formatter(to_string(1000 ., ' ( F6.3) ' ), " *" , &
80
+ call check_formatter(to_string(1000 ., ' F6.3' ), " *" , &
81
81
& " Too narrow formatter for real number" , partial= .true. )
82
- call check_formatter(to_string(1000 ., ' ( 7.3) ' ), " [*]" , &
82
+ call check_formatter(to_string(1000 ., ' 7.3' ), " [*]" , &
83
83
& " Invalid formatter for real number" , partial= .true. )
84
84
85
85
end subroutine test_to_string_real
86
86
87
87
subroutine test_to_string_logical
88
88
call check_formatter(to_string(.true. ), " T" , &
89
89
& " Default formatter for logcal value" )
90
- call check_formatter(to_string(.true. , ' (L2) ' ), " T" , &
90
+ call check_formatter(to_string(.true. , ' L2 ' ), " T" , &
91
91
& " Formatter for logical value" )
92
- call check_formatter(to_string(.false. , ' (L2) ' ) // to_string(.true. , ' (L5)' ), &
92
+ call check_formatter(to_string(.false. , ' L2 ' ) // to_string(.true. , ' (L5)' ), &
93
93
& " F T" , " Multiple formatters for logical values" )
94
94
95
95
! Wrong demonstration
96
- call check_formatter(to_string(.false. , ' (1x) ' ), " [*]" , &
96
+ call check_formatter(to_string(.false. , ' 1x ' ), " [*]" , &
97
97
& " Invalid formatter for logical value" , partial= .true. )
98
98
99
99
end subroutine test_to_string_logical
0 commit comments