11module test_os
22 use testdrive, only : new_unittest, unittest_type, error_type, check, skip_test
33 use stdlib_system, only: get_runtime_os, OS_WINDOWS, OS_UNKNOWN, OS_TYPE, is_windows, null_device, &
4- get_console_width
4+ get_terminal_size
55 implicit none
66
77contains
@@ -12,23 +12,26 @@ subroutine collect_suite(testsuite)
1212 type (unittest_type), allocatable , intent (out ) :: testsuite(:)
1313
1414 testsuite = [ &
15- new_unittest(' test_get_console_width ' , test_get_console_width ), &
15+ new_unittest(' test_get_terminal_size ' , test_get_terminal_size ), &
1616 new_unittest(' test_get_runtime_os' , test_get_runtime_os), &
1717 new_unittest(' test_is_windows' , test_is_windows), &
1818 new_unittest(' test_null_device' , test_null_device) &
1919 ]
2020 end subroutine collect_suite
2121
22- subroutine test_get_console_width (error )
22+ subroutine test_get_terminal_size (error )
2323 type (error_type), allocatable , intent (out ) :: error
24- integer :: width
24+ integer :: columns, lines
2525
26- ! > Get console width
27- width = get_console_width( )
26+ ! > Get terminal size
27+ call get_terminal_size(columns, lines )
2828
29- call check(error, width > 0 , " Console width is not positive" )
29+ call check(error, columns > 0 , " Terminal width is not positive" )
30+ if (allocated (error)) return
31+
32+ call check(error, lines > 0 , " Terminal height is not positive" )
3033
31- end subroutine test_get_console_width
34+ end subroutine test_get_terminal_size
3235
3336 subroutine test_get_runtime_os (error )
3437 type (error_type), allocatable , intent (out ) :: error
0 commit comments