Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ajeetdsouza committed Sep 12, 2024
1 parent b6eef6b commit e0ad7bc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
24 changes: 20 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added

- zsh: improved `cd` completions.
- Lazily delete excluded directories from the database.
- fish: detect infinite loop when using `alias cd=z`.
- Installer: added flags for `--bin-dir`, `--man-dir`, `--arch`, and `--sudo`.
- Nushell: support for v0.94.0+.
- bash/fish/zsh: support for `z -- dir` style queries.
- fish: improved Space-Tab completions.
- ksh: added support for the Korn shell.

### Changed

- fzf: removed `--select-1` from default options. The interactive selector will
now open up even if there is only one match.
- Enforce that `$_ZO_DATA_DIR` is an absolute path.

### Fixed

- zsh: Space-Tab completion repeating output multiple times when matching single
directory
- fish: detect infinite loop when using `alias cd=z`.
- fish / Nushell / PowerShell: handle queries that look like args (e.g. `z -x`).
- zsh: better cd completions.
- elvish: `z -` now work as expected.
- Lazily delete excluded directories from the database.
- elvish: `z -` now works as expected.
- fish: generated shell code avoids using aliased builtins.
- fish: `cd` command is now copied directly from `$__fish_data_dir/functions/cd.fish`. This should minimize the chances of an infinite loop when aliasing `cd=z`.

## [0.9.4] - 2024-02-21

Expand Down
12 changes: 6 additions & 6 deletions src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ mod tests {
#[apply(opts)]
fn ksh_ksh(cmd: Option<&str>, hook: InitHook, echo: bool, resolve_symlinks: bool) {
let opts = Opts { cmd, hook, echo, resolve_symlinks };
let source = Bash(&opts).render().unwrap();
Command::new("bash")
.args(["--noprofile", "--norc", "-e", "-u", "-o", "pipefail", "-c", &source])
let source = Ksh(&opts).render().unwrap();
Command::new("ksh")
.args(["-e", "-u", "-o", "norc", "-o", "pipefail", "-c", &source])
.assert()
.success()
.stdout("")
Expand All @@ -164,7 +164,7 @@ mod tests {
#[apply(opts)]
fn ksh_shellcheck(cmd: Option<&str>, hook: InitHook, echo: bool, resolve_symlinks: bool) {
let opts = Opts { cmd, hook, echo, resolve_symlinks };
let source = Bash(&opts).render().unwrap();
let source = Ksh(&opts).render().unwrap();

Command::new("shellcheck")
.args(["--enable=all", "-"])
Expand All @@ -178,11 +178,11 @@ mod tests {
#[apply(opts)]
fn ksh_shfmt(cmd: Option<&str>, hook: InitHook, echo: bool, resolve_symlinks: bool) {
let opts = Opts { cmd, hook, echo, resolve_symlinks };
let mut source = Bash(&opts).render().unwrap();
let mut source = Ksh(&opts).render().unwrap();
source.push('\n');

Command::new("shfmt")
.args(["--diff", "--indent=4", "--language-dialect=posix", "--simplify", "-"])
.args(["--diff", "--indent=4", "--language-dialect=bash", "--simplify", "-"])
.write_stdin(source)
.assert()
.success()
Expand Down

0 comments on commit e0ad7bc

Please sign in to comment.