Skip to content

Commit b19d447

Browse files
committed
Add integer type tests to test_linspace.f90
1 parent 2843ffd commit b19d447

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

src/tests/math/test_linspace.f90

+49-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
program test_linspace
22
use stdlib_error, only: check
3-
use stdlib_kinds, only: sp, dp
3+
use stdlib_kinds, only: sp, dp, int16, int8
44
use stdlib_math, only: linspace
55

66
implicit none
@@ -28,6 +28,8 @@ program test_linspace
2828
call test_linspace_cmplx_3
2929
call test_linspace_cmplx_sp
3030
call test_linspace_cmplx_sp_2
31+
call test_linspace_int16
32+
call test_linspace_int8
3133

3234
close(unit=iunit)
3335

@@ -193,5 +195,51 @@ subroutine test_linspace_cmplx_sp_2
193195

194196
end subroutine
195197

198+
subroutine test_linspace_int16
199+
200+
integer(int16) :: start = 5
201+
integer(int16) :: end = 10
202+
203+
integer(int16) :: z(6)
204+
205+
integer :: i
206+
207+
z = linspace(start, end, 6)
208+
209+
write(unit=iunit, fmt=*) "linspace(5_int16, 10_int16, 10): "
210+
write(unit=iunit,fmt=99)
211+
do i = 1, 6
212+
write(unit=iunit,fmt=*) z(i)
213+
end do
214+
write(iunit,*)
215+
write(iunit,*)
216+
217+
99 format(70("="))
218+
219+
end subroutine
220+
221+
subroutine test_linspace_int8
222+
223+
integer(int8) :: start = 20
224+
integer(int8) :: end = 50
225+
226+
integer(int8) :: z(10)
227+
228+
integer :: i
229+
230+
z = linspace(start, end, 10)
231+
232+
write(unit=iunit, fmt=*) "linspace(5_int16, 10_int16, 10): "
233+
write(unit=iunit,fmt=99)
234+
do i = 1, 10
235+
write(unit=iunit,fmt=*) z(i)
236+
end do
237+
write(iunit,*)
238+
write(iunit,*)
239+
240+
99 format(70("="))
241+
242+
end subroutine
243+
196244

197245
end program

0 commit comments

Comments
 (0)