Update tests, remove extraneous file

This commit is contained in:
Ilan Cosman 2020-05-15 16:27:26 -07:00
parent 53ed6c2883
commit 305cc12f54
6 changed files with 16 additions and 17 deletions

View File

@ -9,6 +9,6 @@ function _cmd_duration -a duration threshold decimals
end
@test 'Less than threshold' (_cmd_duration 2000 3000 0) -z
@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'
@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 '

View File

@ -7,5 +7,5 @@ function _context
end
@test 'None' (_context) -z
@test 'SSH' (set -g SSH_TTY 'true'; _context) = $USER'@'(prompt_hostname)
@test 'Root' (lean_decolor (su -c "fish -c 'source $sourceFile;_lean_context'")) = 'root@'(prompt_hostname)
@test 'SSH' (set -g SSH_TTY 'true'; _context) = $USER'@'(prompt_hostname)' '
@test 'Root' (lean_decolor (su -c "fish -c 'source $sourceFile;_lean_context'")) = 'root@'(prompt_hostname)' '

View File

@ -5,4 +5,4 @@ function _jobs
end
@test 'No Jobs' (_jobs) -z
@test 'Jobs' (sleep 60 &; _jobs) = "$lean_jobs_icon"
@test 'Jobs' (sleep 60 &; _jobs) = "$lean_jobs_icon "

View File

@ -7,16 +7,16 @@ end
set -l unwr "$lean_pwd_unwritable_icon "
@test '/' (_pwd '/') = $unwr'/'
@test '/usr' (_pwd '/usr') = $unwr'/usr'
@test '/usr/share' (_pwd '/usr/share') = $unwr'/usr/share'
@test '~' (_pwd "$HOME") = '~'
@test '~/.config' (_pwd "$HOME/.config") = '~/.config'
@test '~/.config/fish' (_pwd "$HOME/.config/fish") = '~/.config/fish'
@test '/' (_pwd '/') = $unwr'/ '
@test '/usr' (_pwd '/usr') = $unwr'/usr '
@test '/usr/share' (_pwd '/usr/share') = $unwr'/usr/share '
@test '~' (_pwd "$HOME") = '~ '
@test '~/.config' (_pwd "$HOME/.config") = '~/.config '
@test '~/.config/fish' (_pwd "$HOME/.config/fish") = '~/.config/fish '
set -l longDir "$HOME/alfa/bravo/charlie/delta/echo/foxtrot/golf/hotel/inda/juliett/kilo/lima/mike/november/oscar/papa"
if not test -e $longDir
mkdir -p $longDir
end
@test 'Long dir' (_pwd "$longDir") = '~/a/b/c/d/e/f/golf/hotel/inda/juliett/kilo/lima/mike/november/oscar/papa'
@test 'Long dir' (_pwd "$longDir") = '~/a/b/c/d/e/f/golf/hotel/inda/juliett/kilo/lima/mike/november/oscar/papa '
rm -r $longDir

View File

@ -8,7 +8,7 @@ end
@test 'true' (true; _status) -z
@test 'false' (false; _status) -z
@test 'true|false' (true|false; _status) = "$lean_status_failure_icon 0|1"
@test 'true|false' (true|false; _status) = "$lean_status_failure_icon 0|1 "
@test 'true|true' (true|true; _status) -z
@test 'false|true' (false|true; _status) = "$lean_status_success_icon 1|0"
@test 'false|false' (false|false; _status) = "$lean_status_failure_icon 1|1"
@test 'false|true' (false|true; _status) = "$lean_status_success_icon 1|0 "
@test 'false|false' (false|false; _status) = "$lean_status_failure_icon 1|1 "

1
yeet
View File

@ -1 +0,0 @@
master(B !1(B ?2(B