chore(complete): Update completest

This commit is contained in:
Ed Page 2023-07-21 14:42:49 -05:00
parent e82234162c
commit 0137a8be65
7 changed files with 10 additions and 10 deletions

4
Cargo.lock generated
View file

@ -646,9 +646,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
[[package]]
name = "completest"
version = "0.0.11"
version = "0.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d5c57cc5ce58820d1da6538531606500422d4c9cbaea47f6a14d9ed96717a8b"
checksum = "76e97ff3875a8bb8020fa8897bc79583e71258d2e78b033af571606213f90beb"
dependencies = [
"ptyprocess",
"vte 0.11.1",

View file

@ -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]]

View file

@ -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#"%

View file

@ -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();
@ -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

View file

@ -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

View file

@ -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

View file

@ -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