From 5f58628d8ab39008d2879dadd7a0dd7d1001459d Mon Sep 17 00:00:00 2001 From: Will Owens Date: Fri, 23 Feb 2024 04:26:43 -0500 Subject: [PATCH] [shell_shortcuts] fix test by adding dir to / that will match $e1 --- test/lib/git/shell_shortcuts_test.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/lib/git/shell_shortcuts_test.sh b/test/lib/git/shell_shortcuts_test.sh index d28fcdc..94f3735 100755 --- a/test/lib/git/shell_shortcuts_test.sh +++ b/test/lib/git/shell_shortcuts_test.sh @@ -49,6 +49,8 @@ oneTimeSetUp() { # Test already wrapped commands alias cat="exec_scmb_expand_args $cat_path" + sudo mkdir /aaa + # Run shortcut wrapping source "$scmbDir/lib/git/shell_shortcuts.sh" @@ -141,10 +143,14 @@ test_ls_with_file_shortcuts() { assertFalse 'Fails on /' 'ls_with_file_shortcuts 1 1/file' # Files under the root directory - assertTrue 'Shortcuts under /' 'ls_with_file_shortcuts / > /dev/null && [[ $e1 =~ ^/[^/]+$ ]]' + assertTrue 'Shortcuts under /' 'ls_with_file_shortcuts / >/dev/null && [[ $e1 =~ ^/[^/]+$ ]]' + + ls_with_file_shortcuts / >/dev/null + assertTrue "$e1 == /aaa" '[[ "$e1" == "/aaa" ]]' cd - rm -r "$TEST_DIR" "$temp_file" + sudo rmdir /aaa } # load and run shUnit2