tide/tests/detect_os/_tide_detect_os.test.fish

40 lines
800 B
Fish
Raw Normal View History

2022-04-10 23:34:06 +03:00
# RUN: %fish %s
2022-09-05 19:56:50 +03:00
_tide_parent_dirs
2022-04-10 23:34:06 +03:00
mock uname \* "echo Darwin"
_tide_detect_os
# CHECK: 
# CHECK: D6D6D6
# CHECK: 333333
mock uname \* "echo Linux"
mock uname -o "echo Android"
_tide_detect_os
2022-04-30 01:07:04 +03:00
# CHECK: ﲎ
# CHECK: 3DDC84
# CHECK: 3C3F41
2022-04-10 23:34:06 +03:00
function _detect_os_linux_cases -a file
set -l dir (status dirname)
_tide_detect_os_linux_cases $dir/$file ID ||
_tide_detect_os_linux_cases $dir/$file ID_LIKE ||
_tide_detect_os_linux_cases $dir/$file DISTRIB_ID
end
_detect_os_linux_cases endeavouros-etc-release
# CHECK: 
# CHECK: 1793D1
# CHECK: 4D4D4D
# This tests spaces, e.g "opensuse suse"
_detect_os_linux_cases opensuse-etc-release
# CHECK: 
# CHECK: 73BA25
# CHECK: 173f4f
2023-04-01 20:31:43 +03:00
_detect_os_linux_cases linuxmint-etc-release
# CHECK: 
# CHECK: FFFFFF
# CHECK: 69B53F