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

chore(complete): Update completest #5034

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clap_complete/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ unicode-xid = { version = "0.2.2", optional = true }
snapbox = { version = "0.4.11", features = ["diff", "path", "examples"] }
# Cutting out `filesystem` feature
trycmd = { version = "0.14.16", default-features = false, features = ["color-auto", "diff", "examples"] }
completest = "0.0.11"
completest = "0.0.12"
clap = { path = "../", version = "4.0.0", default-features = false, features = ["std", "derive", "help"] }

[[example]]
Expand Down
2 changes: 1 addition & 1 deletion clap_complete/tests/testsuite/bash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ fn complete() {
}

let term = completest::Term::new();
let runtime = common::load_runtime("test", completest::Shell::Bash);
let mut runtime = common::load_runtime("test", completest::Shell::Bash);

let input = "test \t\t";
let expected = r#"%
Expand Down
6 changes: 3 additions & 3 deletions clap_complete/tests/testsuite/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ pub fn register_example(name: &str, shell: completest::Shell) {
let registration = std::str::from_utf8(&registration.stdout).unwrap();
assert!(!registration.is_empty());

let runtime = shell.init(bin_root, scratch_path.to_owned()).unwrap();
let mut runtime = shell.init(bin_root, scratch_path.to_owned()).unwrap();

runtime.register(name, registration).unwrap();

Expand Down Expand Up @@ -408,11 +408,11 @@ impl completest::Runtime for ScratchRuntime {
self.runtime.home()
}

fn register(&self, name: &str, content: &str) -> std::io::Result<()> {
fn register(&mut self, name: &str, content: &str) -> std::io::Result<()> {
self.runtime.register(name, content)
}

fn complete(&self, input: &str, term: &completest::Term) -> std::io::Result<String> {
fn complete(&mut self, input: &str, term: &completest::Term) -> std::io::Result<String> {
let output = self.runtime.complete(input, term)?;
// HACK: elvish prints and clears this message when a completer takes too long which is
// dependent on a lot of factors, making this show up or no sometimes (especially if we
Expand Down
2 changes: 1 addition & 1 deletion clap_complete/tests/testsuite/elvish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fn complete() {
}

let term = completest::Term::new();
let runtime = common::load_runtime("test", completest::Shell::Elvish);
let mut runtime = common::load_runtime("test", completest::Shell::Elvish);

let input = "test \t";
let expected = r#"% test --generate
Expand Down
2 changes: 1 addition & 1 deletion clap_complete/tests/testsuite/fish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fn complete() {
}

let term = completest::Term::new();
let runtime = common::load_runtime("test", completest::Shell::Fish);
let mut runtime = common::load_runtime("test", completest::Shell::Fish);

let input = "test \t";
let expected = r#"% test
Expand Down
2 changes: 1 addition & 1 deletion clap_complete/tests/testsuite/zsh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fn complete() {
}

let term = completest::Term::new();
let runtime = common::load_runtime("test", completest::Shell::Zsh);
let mut runtime = common::load_runtime("test", completest::Shell::Zsh);

let input = "test \t";
let expected = r#"% test
Expand Down