-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The bug in `path_opentype()` fixed by this commit may affect other scenarios but we know it affects autoloaded functions. Hence the unit test for that scenario. Fixes #1454
- Loading branch information
1 parent
5abcbd0
commit 3bc5816
Showing
4 changed files
with
40 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Verify the behavior of autoloaded functions. | ||
|
||
# ==================== | ||
# Verify that directories in the path search list which should be skipped (e.g., because they don't | ||
# exist) interacts correctly with autoloaded functions. | ||
# | ||
# See https://github.com/att/ast/issues/1454 | ||
expect=$"Func cd called with |$TEST_DIR/usr|\n$TEST_DIR/usr" | ||
actual=$($SHELL "$TEST_ROOT/data/skipped_dir") | ||
actual_status=$? | ||
expect_status=0 | ||
[[ $actual_status == $expect_status ]] || | ||
log_error "autoload function skipped dir test wrong status" "$expect_status" "$actual_status" | ||
[[ $actual == $expect ]] || | ||
log_error "autoload function skipped dir test wrong output" "$expect" "$actual" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# See https://github.com/att/ast/issues/1454 | ||
|
||
mkdir -p "$TEST_DIR/usr/bin" | ||
print '#!/bin/sh' >"$TEST_DIR/usr/bin/cd" | ||
print 'builtin cd "$@"' >>"$TEST_DIR/usr/bin/cd" | ||
prefix="$TEST_DIR/ksh.$$" | ||
|
||
FPATH="$prefix/bad:$prefix/functions" | ||
mkdir -p "$prefix/functions" | ||
print 'function cd { echo "Func cd called with |$*|"; command cd "$@"; }' >"$prefix/functions/cd" | ||
typeset -fu cd | ||
|
||
PATH="/arglebargle:$PATH:$TEST_DIR/usr/bin:$TEST_DIR/bin" | ||
cd "$TEST_DIR/usr" | ||
pwd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters