Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC-ish: dymanic completions: test a hack that checks availability of generated completions #5376

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cli/tests/test_completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,12 @@ fn test_completions_are_generated() {
// cannot use assert_snapshot!, output contains path to binary that depends
// on environment
assert!(stdout.starts_with("complete --keep-order --exclusive --command jj --arguments"));
let stdout = test_env.jj_cmd_success(test_env.env_root(), &["--"]);
assert!(stdout.starts_with("complete --keep-order --exclusive --command jj --arguments"));
let stdout_dashdash = test_env.jj_cmd_success(test_env.env_root(), &["--"]);
assert_eq!(stdout, stdout_dashdash);
// Used in https://github.com/fish-shell/fish-shell/pull/11046 to check
// whether `jj` is new enough to support dynamic completions
let stdout_unknowncommand = test_env.jj_cmd_success(test_env.env_root(), &["random-command"]);
assert_eq!(stdout, stdout_unknowncommand);
}

#[test]
Expand Down