tide/tests/_tide_item_status.test.fish

60 lines
877 B
Fish
Raw Normal View History

2021-01-26 04:34:15 +03:00
# RUN: %fish %s
2020-05-09 08:48:35 +03:00
function _status
2021-03-26 17:38:10 +03:00
set -lx _tide_last_status $status
set -lx _tide_last_pipestatus $pipestatus
2020-05-22 00:58:09 +03:00
_tide_decolor (_tide_item_status)
2020-05-06 19:42:52 +03:00
end
2020-07-12 02:45:23 +03:00
set -lx tide_status_success_icon '✔'
set -lx tide_status_failure_icon '✘'
# Without prompt_char
set -lx tide_left_prompt_items
2020-07-09 04:37:47 +03:00
2021-01-26 04:34:15 +03:00
true
_status # CHECK: ✔
2021-01-26 04:34:15 +03:00
false
_status # CHECK: ✘ 1
2021-01-26 04:34:15 +03:00
true | false
_status # CHECK: ✘ 0|1
true | true
_status # CHECK: ✔
2021-01-26 04:34:15 +03:00
false | true
_status # CHECK: ✔ 1|0
false | false
_status # CHECK: ✘ 1|1
2020-07-09 04:37:47 +03:00
# With prompt_char
set -lx tide_left_prompt_items prompt_char
2020-07-09 04:37:47 +03:00
2021-01-26 04:34:15 +03:00
true
_status # CHECK:
2021-01-26 04:34:15 +03:00
false
_status # CHECK:
2021-01-26 04:34:15 +03:00
true | false
_status # CHECK: ✘ 0|1
true | true
_status # CHECK:
2021-01-26 04:34:15 +03:00
false | true
_status # CHECK: ✔ 1|0
false | false
_status # CHECK: ✘ 1|1
2021-03-26 17:38:10 +03:00
# Check that not command works
not true | false
_status # CHECK: ✔ 0|1
not false | true
_status # CHECK: ✘ 1|0