Skip to content

Commit

Permalink
test (ble/util/readlink): work around external aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Nov 12, 2022
1 parent 8cb9b84 commit 0c6291f
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 15 deletions.
2 changes: 1 addition & 1 deletion contrib
Submodule contrib updated 1 files
+1 −1 fzf-completion.bash
8 changes: 5 additions & 3 deletions docs/ChangeLog.md
Expand Up @@ -313,15 +313,15 @@
- main. util: fix problems of readlink etc. found by test in macOS (reported by aiotter) `#D1849` fa955c1 `#D1855` a22e145
- progcomp: fix a bug that `COMP_WORDBREAKS` is ignored `#D1872` 4d2dd35
- global: quote `return $?` `#D1884` 801d14a
- benchmark (zsh): fix for `KSH_ARRAYS` `#D1886` a144ffa xxxxxxx
- benchmark (zsh): fix for `KSH_ARRAYS` `#D1886` a144ffa 8cb9b84

## Documentation

- blerc: add all the missing options `#D1667` 0228d76
- blerc: add missing faces `argument_option` and `cmdinfo_cd_cdpath` (reported by Prikalel) `#D1675` 26aaf87
- README: describe how to invoke multiple widgets with a keybinding (motivated by michaelmob) `#D1699` 6123551
- README: add links to `bash-it` and `oh-my-bash` `#D1724` 4a2575f
- README: mention the Guix package (motivated by kiasoc5) `#D1888` xxxxxxx
- README: mention the Guix package (motivated by kiasoc5) `#D1888` 0f7c04b

## Optimization

Expand Down Expand Up @@ -444,6 +444,7 @@
- util (ble/util/s2bytes): clear locale cache `#D1881` 2e1a7c1
- complete: fix syntax error for bash-3.0 `#D1881` 0b3e611
- test (ble/util/writearray): use `ble/file#hash` instead of `sha256sum` `#D1882` b76e21e
- test (ble/util/readlink): work around external aliases `#D1890` xxxxxxx

## Internal changes and fixes

Expand Down Expand Up @@ -481,7 +482,7 @@
- global: quote numbers for unexpected `IFS` `#D1835` 0179afc
- history: refactor hooks `history_{{delete,clear,insert} => change}` `#D1860` c393c93
- history: rename the hook `history_{on => }leave` `#D1860` c393c93
- make: check necessary `.git` `#D1887` xxxxxxx
- make: check necessary `.git` `#D1887` 0f7c04b

## Contrib

Expand All @@ -490,6 +491,7 @@
- config/execmark: show exit status in a separate line `#D1828` 4d24f84
- prompt-git: ignore untracked files in submodules `#D1829` 4d24f84
- contrib/fzf-completion: fix integration (reported by ferdinandyb) `#D1837` 12c022b
- contrib/fzf-completion: remove `noquote` (reported by MK-Alias) `#D1889` xxxxxxx

<!---------------------------------------------------------------------------->
# ble-0.4.0-devel2
Expand Down
22 changes: 11 additions & 11 deletions lib/test-main.sh
Expand Up @@ -50,23 +50,23 @@ ble/test/start-section 'ble/main' 19
ble/test/chdir
cd -P .

mkdir -p ab/cd/ef
touch ab/cd/ef/file.txt
ln -s ef/file.txt ab/cd/link1
ln -s ab link.d
ln -s link.d/cd/link1 f.txt
command mkdir -p ab/cd/ef
command touch ab/cd/ef/file.txt
command ln -s ef/file.txt ab/cd/link1
command ln -s ab link.d
command ln -s link.d/cd/link1 f.txt
ble/test '
ble/util/readlink f.txt
[[ $ret != /* ]] && ret=${PWD%/}/$ret' \
ret="${PWD%/}/ab/cd/ef/file.txt"

# loop symbolic links
touch loop1.sh
ln -s loop1.sh loop0.sh
ln -s loop1.sh loop3.sh
rm loop1.sh
ln -s loop3.sh loop2.sh
ln -s loop2.sh loop1.sh
command touch loop1.sh
command ln -s loop1.sh loop0.sh
command ln -s loop1.sh loop3.sh
command rm loop1.sh
command ln -s loop3.sh loop2.sh
command ln -s loop2.sh loop1.sh
for impl in impl1 impl2; do
ble/test "ble/test:readlink.$impl loop0.sh" ret='loop1.sh'
done
Expand Down
34 changes: 34 additions & 0 deletions note.txt
Expand Up @@ -6638,6 +6638,40 @@ bash_tips
Done (実装ログ)
-------------------------------------------------------------------------------

2022-11-12

* test: テストで用いている rm が alias によって rm -i になって失敗する [#D1890]

これはテストの方を修正する事にした。他に類似の箇所はなかった。これは単独修
正で良い。但し #D1889 のcontrib の更新も含める。

* fzf-completion 経由で補完した path の特別文字が正しく quote されない (reported by MK-Alias) [#D1889]
https://github.com/akinomyoga/ble.sh/issues/250

fzf-completion.bash の中で noquote をしているのが原因の様である。noquote を
つけた経緯について調べる。syntax-raw を付加したのは fb145dea (contrib) であ
る。そして noquote をつけた箇所を確認しようとしたがどうも contrib の
initial commit から noquote がついていた様である。つまり、色々の報告があっ
た間も全然修正されなかった振る舞いという事である。なので余り深く考えられて
いる訳でもない気がする。

contrib を導入したのは f2901158 #D1335 (2020-04-16) の様である。contrib の
最初の commit では補完関数の advice は以下の様になっていた。

function _fzf_complete.advice {
[[ :$comp_type: == *:auto:* ]] && return
compopt -o noquote
COMP_WORDS=("${comp_words[@]}") COMP_CWORD=$comp_cword
COMP_LINE=$comp_line COMP_POINT=$comp_point
ble/function#push printf '[[ $1 == "\e[5n" ]] || builtin printf "$@"'
ble/function#advice/do <> /dev/tty >&0 2>&0
ble/function#pop printf
ble/textarea#invalidate
}

そんなに深く考えられている様には思われない。単に noquote を外してしまって良
い気がする。

2022-10-02

* README: Guix の package 一覧に追加する (motivated by kiasoc5) [#D1888]
Expand Down

0 comments on commit 0c6291f

Please sign in to comment.