Skip to content

Commit ff46b12

Browse files
committed
Changed along suggestions by reviewers
1 parent fafd229 commit ff46b12

File tree

4 files changed

+25
-28
lines changed

4 files changed

+25
-28
lines changed

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ fypp_f90("${fyppFlags}" "${fppFiles}" outFiles)
2121

2222
set(SRC
2323
stdlib_experimental_ascii.f90
24-
stdlib_experimental_io.f90
2524
stdlib_experimental_error.f90
2625
stdlib_experimental_kinds.f90
2726
stdlib_experimental_optval.f90

src/stdlib_experimental_io.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Loads a rank-2 `array` from a text file.
2020

2121
`filename`: Shall be a character expression containing the file name from which to load the rank-2 `array`.
2222

23-
`array`: Shall be an allocatable rank-2 array of type `real` or `integer`.
23+
`array`: Shall be an allocatable rank-2 array of type `real`, `complex` or `integer`.
2424

2525
### Return value
2626

@@ -104,7 +104,7 @@ Saves a rank-2 `array` into a text file.
104104

105105
`filename`: Shall be a character expression containing the name of the file that will contain the 2D `array`.
106106

107-
`array`: Shall be a rank-2 array of type `real` or `integer`.
107+
`array`: Shall be a rank-2 array of type `real`, `complex` or `integer`.
108108

109109
### Output
110110

src/tests/io/test_savetxt.f90

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ program test_savetxt
88

99
outpath = get_outpath() // "/tmp.dat"
1010

11-
call test_int32(outpath)
11+
call test_iint32(outpath)
1212
call test_rsp(outpath)
1313
call test_rdp(outpath)
1414
call test_csp(outpath)
@@ -29,7 +29,7 @@ function get_outpath() result(outpath)
2929
endif
3030
end function get_outpath
3131

32-
subroutine test_int32(outpath)
32+
subroutine test_iint32(outpath)
3333
character(*), intent(in) :: outpath
3434
integer(int32) :: d(3, 2), e(2, 3)
3535
integer(int32), allocatable :: d2(:, :)
@@ -62,10 +62,10 @@ subroutine test_rsp(outpath)
6262
call loadtxt(outpath, d2)
6363
call assert(all(shape(d2) == [2, 3]))
6464
call assert(all(abs(e-d2) < epsilon(1._sp)))
65-
end subroutine
65+
end subroutine test_rsp
6666

6767

68-
subroutine test_rdp(outpath)
68+
subroutine test_rdp(outpath)
6969
character(*), intent(in) :: outpath
7070
real(dp) :: d(3, 2), e(2, 3)
7171
real(dp), allocatable :: d2(:, :)
@@ -80,7 +80,7 @@ subroutine test_rdp(outpath)
8080
call loadtxt(outpath, d2)
8181
call assert(all(shape(d2) == [2, 3]))
8282
call assert(all(abs(e-d2) < epsilon(1._dp)))
83-
end subroutine
83+
end subroutine test_rdp
8484

8585
subroutine test_csp(outpath)
8686
character(*), intent(in) :: outpath
@@ -97,7 +97,7 @@ subroutine test_csp(outpath)
9797
call loadtxt(outpath, d2)
9898
call assert(all(shape(d2) == [2, 3]))
9999
call assert(all(abs(e-d2) < epsilon(1._sp)))
100-
end subroutine
100+
end subroutine test_csp
101101

102102
subroutine test_cdp(outpath)
103103
character(*), intent(in) :: outpath
@@ -114,6 +114,6 @@ subroutine test_cdp(outpath)
114114
call loadtxt(outpath, d2)
115115
call assert(all(shape(d2) == [2, 3]))
116116
call assert(all(abs(e-d2) < epsilon(1._dp)))
117-
end subroutine
117+
end subroutine test_cdp
118118

119119
end program test_savetxt

src/tests/io/test_savetxt_qp.f90

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
program test_savetxt_qp
2-
use stdlib_experimental_kinds, only: qp
3-
use stdlib_experimental_io, only: loadtxt, savetxt
4-
use stdlib_experimental_error, only: assert
5-
implicit none
2+
use stdlib_experimental_kinds, only: qp
3+
use stdlib_experimental_io, only: loadtxt, savetxt
4+
use stdlib_experimental_error, only: assert
5+
implicit none
66

7-
character(:), allocatable :: outpath
7+
character(:), allocatable :: outpath
88

9-
outpath = get_outpath() // "/tmp_qp.dat"
9+
outpath = get_outpath() // "/tmp_qp.dat"
1010

11-
call test_qp(outpath)
12-
call test_cqp(outpath)
11+
call test_rqp(outpath)
12+
call test_cqp(outpath)
1313

1414
contains
1515

16-
function get_outpath() result(outpath)
16+
function get_outpath() result(outpath)
1717
integer :: ierr
1818
character(256) :: argv
1919
character(:), allocatable :: outpath
2020

2121
call get_command_argument(1, argv, status=ierr)
2222
if (ierr==0) then
23-
outpath = trim(argv)
23+
outpath = trim(argv)
2424
else
25-
outpath = '.'
25+
outpath = '.'
2626
endif
27-
end function get_outpath
27+
end function get_outpath
2828

29-
subroutine test_qp(outpath)
29+
subroutine test_rqp(outpath)
3030
character(*), intent(in) :: outpath
3131
real(qp) :: d(3, 2), e(2, 3)
3232
real(qp), allocatable :: d2(:, :)
@@ -41,10 +41,9 @@ subroutine test_qp(outpath)
4141
call loadtxt(outpath, d2)
4242
call assert(all(shape(d2) == [2, 3]))
4343
call assert(all(abs(e-d2) < epsilon(1._qp)))
44-
end subroutine test_qp
44+
end subroutine test_rqp
4545

46-
47-
subroutine test_cqp(outpath)
46+
subroutine test_cqp(outpath)
4847
character(*), intent(in) :: outpath
4948
complex(qp) :: d(3, 2), e(2, 3)
5049
complex(qp), allocatable :: d2(:, :)
@@ -59,7 +58,6 @@ subroutine test_cqp(outpath)
5958
call loadtxt(outpath, d2)
6059
call assert(all(shape(d2) == [2, 3]))
6160
call assert(all(abs(e-d2) < epsilon(1._qp)))
62-
end subroutine test_cqp
63-
61+
end subroutine test_cqp
6462

6563
end program test_savetxt_qp

0 commit comments

Comments
 (0)