11module test_os
22 use testdrive, only : new_unittest, unittest_type, error_type, check, skip_test
3- use stdlib_system, only: get_runtime_os, OS_WINDOWS, OS_UNKNOWN, OS_TYPE, is_windows, null_device
4-
3+ use stdlib_system, only: get_runtime_os, OS_WINDOWS, OS_UNKNOWN, OS_TYPE, is_windows, null_device, &
4+ get_console_width
55 implicit none
66
77contains
@@ -12,12 +12,24 @@ 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), &
1516 new_unittest(' test_get_runtime_os' , test_get_runtime_os), &
1617 new_unittest(' test_is_windows' , test_is_windows), &
1718 new_unittest(' test_null_device' , test_null_device) &
1819 ]
1920 end subroutine collect_suite
2021
22+ subroutine test_get_console_width (error )
23+ type (error_type), allocatable , intent (out ) :: error
24+ integer :: width
25+
26+ ! > Get console width
27+ width = get_console_width()
28+
29+ call check(error, width > 0 , " Console width is not positive" )
30+
31+ end subroutine test_get_console_width
32+
2133 subroutine test_get_runtime_os (error )
2234 type (error_type), allocatable , intent (out ) :: error
2335 integer :: os
0 commit comments