tide/tests/cmd_duration.fish

14 lines
509 B
Fish
Raw Normal View History

2020-05-10 01:38:07 +03:00
@mesg '---------cmd_duration---------'
2020-05-09 08:48:35 +03:00
function _cmd_duration -a duration threshold decimals
set -g CMD_DURATION $duration
2020-05-19 06:03:25 +03:00
set -g tide_cmd_duration_threshold $threshold
set -g tide_cmd_duration_decimals $decimals
2020-05-09 08:48:35 +03:00
2020-05-22 00:58:09 +03:00
_tide_decolor (_tide_item_cmd_duration)
2020-05-09 08:48:35 +03:00
end
@test 'Less than threshold' (_cmd_duration 2000 3000 0) -z
2020-05-16 02:27:26 +03:00
@test 'Decimals' (_cmd_duration 4567 3000 3) = '4.567s '
@test 'Minutes' (_cmd_duration 456700 3000 0) = '7m 36s '
@test 'Hours' (_cmd_duration 4567000 3000 0) = '1h 16m 7s '