Skip to content

Commit

Permalink
[spec/ysh-special-vars] Fix tests after moving local dir
Browse files Browse the repository at this point in the history
~/git/oilshell/oil/ versus ~/git/oils-for-unix/oils
  • Loading branch information
Andy C committed Jan 6, 2025
1 parent 21e8165 commit 2805d23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion spec/testdata/module/this_dir.ysh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
echo 'hi from this_dir.ysh'

write -n '$_this_dir = '
echo $_this_dir | sed 's;.*/oil/;REPLACED/oil/;'

# support git/oilshell/oil/ or git/oils-for-unix/oils
echo $_this_dir | sed 's;.*/oils\?/;REPLACED/oils/;'

source $_this_dir/empty.ysh
10 changes: 5 additions & 5 deletions spec/ysh-special-vars.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ $[ENV.SH] -i --rcfile $[ENV.REPO_ROOT]/spec/testdata/module/this_dir.ysh -c 'ech

## STDOUT:
hi from this_dir.ysh
$_this_dir = REPLACED/oil/spec/testdata/module
$_this_dir = REPLACED/oils/spec/testdata/module
interactive
hi from this_dir.ysh
$_this_dir = REPLACED/oil/spec/testdata/module
$_this_dir = REPLACED/oils/spec/testdata/module
-c
## END

Expand All @@ -29,7 +29,7 @@ not yet
source $[ENV.REPO_ROOT]/spec/testdata/module/this_dir.ysh
## STDOUT:
hi from this_dir.ysh
$_this_dir = REPLACED/oil/spec/testdata/module
$_this_dir = REPLACED/oils/spec/testdata/module
## END


Expand All @@ -38,13 +38,13 @@ cd /tmp
source $[ENV.REPO_ROOT]/spec/testdata/module/this_dir.ysh
## STDOUT:
hi from this_dir.ysh
$_this_dir = REPLACED/oil/spec/testdata/module
$_this_dir = REPLACED/oils/spec/testdata/module
## END

#### _this_dir used with relative path
cd $[ENV.REPO_ROOT]
source spec/testdata/module/this_dir.ysh
## STDOUT:
hi from this_dir.ysh
$_this_dir = REPLACED/oil/spec/testdata/module
$_this_dir = REPLACED/oils/spec/testdata/module
## END

0 comments on commit 2805d23

Please sign in to comment.