mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-12-27 11:32:44 +00:00
Run shell tests in a clean env
This commit is contained in:
parent
753d95e5a4
commit
14b150c1f7
1
.github/workflows/cargo-audit.yml
vendored
1
.github/workflows/cargo-audit.yml
vendored
@ -19,4 +19,5 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/audit-check@v1
|
||||
with:
|
||||
args: --color=always
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
2
.github/workflows/cargo-clippy.yml
vendored
2
.github/workflows/cargo-clippy.yml
vendored
@ -20,5 +20,5 @@ jobs:
|
||||
components: clippy
|
||||
- uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
args: --all-targets --all-features -- -D warnings -D clippy::all
|
||||
args: --all-targets --all-features --color=always -- -D warnings -D clippy::all
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
2
.github/workflows/cargo-fmt.yml
vendored
2
.github/workflows/cargo-fmt.yml
vendored
@ -18,4 +18,4 @@ jobs:
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: -- --check
|
||||
args: -- --check --color=always
|
||||
|
6
.github/workflows/cargo-test.yml
vendored
6
.github/workflows/cargo-test.yml
vendored
@ -14,12 +14,12 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: cachix/install-nix-action@v12
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
nix_path: nixpkgs=channel:nixos-stable
|
||||
# - uses: cachix/cachix-action@v8
|
||||
# with:
|
||||
# name: zoxide
|
||||
# authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
- run: nix-shell --run "cargo test --no-fail-fast"
|
||||
- run: nix-shell --pure --run "cargo test --all-features --all-targets --color=always --no-fail-fast"
|
||||
test-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
@ -32,4 +32,4 @@ jobs:
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --all-features --no-fail-fast
|
||||
args: --all-features --all-targets --color=always --no-fail-fast
|
||||
|
2
.github/workflows/cargo-udeps.yml
vendored
2
.github/workflows/cargo-udeps.yml
vendored
@ -22,4 +22,4 @@ jobs:
|
||||
crate: cargo-udeps
|
||||
version: latest
|
||||
use-tool-cache: true
|
||||
- run: cargo udeps --all-features --all-targets
|
||||
- run: cargo udeps --all-features --all-targets --color=always
|
||||
|
12
src/shell.rs
12
src/shell.rs
@ -104,7 +104,7 @@ mod tests {
|
||||
let opts = dbg!(&opts()[i]);
|
||||
let source = Bash(opts).render().unwrap();
|
||||
Command::new("bash")
|
||||
.args(&["-c", &source])
|
||||
.args(&["-c", &source, "--noediting", "--noprofile", "--norc"])
|
||||
.assert()
|
||||
.success()
|
||||
.stdout("")
|
||||
@ -145,7 +145,7 @@ mod tests {
|
||||
let opts = dbg!(&opts()[i]);
|
||||
let source = Fish(opts).render().unwrap();
|
||||
Command::new("fish")
|
||||
.args(&["-c", &source])
|
||||
.args(&["--command", &source, "--private"])
|
||||
.assert()
|
||||
.success()
|
||||
.stdout("")
|
||||
@ -159,7 +159,7 @@ mod tests {
|
||||
let opts = dbg!(&opts()[i]);
|
||||
let source = Posix(opts).render().unwrap();
|
||||
let assert = Command::new("bash")
|
||||
.args(&["--posix", "-c", &source])
|
||||
.args(&["--posix", "-c", &source, "--noediting", "--noprofile", "--norc"])
|
||||
.assert()
|
||||
.success()
|
||||
.stderr("");
|
||||
@ -218,7 +218,7 @@ mod tests {
|
||||
let opts = dbg!(&opts()[i]);
|
||||
let source = PowerShell(opts).render().unwrap();
|
||||
Command::new("pwsh")
|
||||
.args(&["-c", &source])
|
||||
.args(&["-Command", &source, "-NoLogo", "-NonInteractive", "-NoProfile"])
|
||||
.assert()
|
||||
.success()
|
||||
.stdout("")
|
||||
@ -269,7 +269,7 @@ mod tests {
|
||||
let opts = dbg!(&opts()[i]);
|
||||
let source = Xonsh(opts).render().unwrap();
|
||||
Command::new("xonsh")
|
||||
.args(&["-c", &source])
|
||||
.args(&["-c", &source, "--no-rc"])
|
||||
.assert()
|
||||
.success()
|
||||
.stdout("")
|
||||
@ -281,7 +281,7 @@ mod tests {
|
||||
let opts = dbg!(&opts()[i]);
|
||||
let source = Zsh(opts).render().unwrap();
|
||||
Command::new("zsh")
|
||||
.args(&["-c", &source])
|
||||
.args(&["-c", &source, "--no-rcs"])
|
||||
.assert()
|
||||
.success()
|
||||
.stdout("")
|
||||
|
Loading…
Reference in New Issue
Block a user