Skip to content

Commit

Permalink
chore(complete): Update completest
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jul 21, 2023
1 parent e822341 commit 0137a8b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
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
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
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
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
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
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
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

0 comments on commit 0137a8b

Please sign in to comment.