From 802718c58cb20a46eeec7a187d01f56d12f19c24 Mon Sep 17 00:00:00 2001 From: Ilan Cosman Date: Sun, 12 Jul 2020 20:36:03 -0700 Subject: [PATCH] Update pwd test, should work on mac now --- tide_theme/tests/pwd.fish | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tide_theme/tests/pwd.fish b/tide_theme/tests/pwd.fish index cfff3c0..f7c1852 100644 --- a/tide_theme/tests/pwd.fish +++ b/tide_theme/tests/pwd.fish @@ -5,23 +5,26 @@ function _pwd -a dir _tide_decolor (_tide_item_pwd) end +# Dont forget that ~ doesn't expand to $HOME in quotes + # Unwritable directories -sudo mkdir -p /unwritable/dir +sudo mkdir -p ~/unwritable/dir -set -lx tide_pwd_unwritable_icon  +set -lx tide_pwd_unwritable_icon '' -@test '/' (_pwd '/') = ' /' -@test '/unwritable' (_pwd '/unwritable') = ' /unwritable' -@test '/unwritable/dir' (_pwd '/unwritable/dir') = ' /unwritable/dir' +@test '~/unwritable' (_pwd ~/unwritable) = ' ~/unwritable' +@test '~/unwritable/dir' (_pwd ~/unwritable/dir) = ' ~/unwritable/dir' + +# sudo rm -rf ~/unwritable + +# No icon / directories set -lx tide_pwd_unwritable_icon @test '/' (_pwd '/') = '/' -@test '/unwritable' (_pwd '/unwritable') = '/unwritable' -@test '/unwritable/dir' (_pwd '/unwritable/dir') = '/unwritable/dir' - -sudo rm -rf /unwritable +@test '/usr' (_pwd '/usr') = '/usr' +@test '/usr/share' (_pwd '/usr/share') = '/usr/share' # Normal directories @@ -35,7 +38,7 @@ rm -rf ~/normal # Long directories -set -l longDir "$HOME/alfa/bravo/charlie/delta/echo/foxtrot/golf/hotel/inda/juliett/kilo/lima/mike/november/oscar/papa" +set -l longDir ~/alfa/bravo/charlie/delta/echo/foxtrot/golf/hotel/inda/juliett/kilo/lima/mike/november/oscar/papa mkdir -p $longDir @test 'Long dir' (_pwd "$longDir") = '~/a/b/c/d/e/f/g/hotel/inda/juliett/kilo/lima/mike/november/oscar/papa'