aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid LeGare <legare@google.com>2022-03-02 16:20:50 +0000
committerDavid LeGare <legare@google.com>2022-03-02 16:20:50 +0000
commit12ae7f8ab5cf4a3a9ca976e28dac441edcdd5e0b (patch)
tree5e9db6a19f0e1fbcb8b1819da7ec93b5055eccfc /tests
parentfaeebbcc228cc4e5c02f1ba19a64c154d6d833fd (diff)
downloadstructopt-12ae7f8ab5cf4a3a9ca976e28dac441edcdd5e0b.tar.gz
Update structopt to 0.3.26
Test: cd external/rust/crates && atest --host -c Change-Id: Iaeee8c2cf42b73912e007f71bdcaeb1db91db18c
Diffstat (limited to 'tests')
-rw-r--r--tests/issues.rs28
-rw-r--r--tests/ui/skip_without_default.stderr12
2 files changed, 34 insertions, 6 deletions
diff --git a/tests/issues.rs b/tests/issues.rs
index 5860c49..3f9e1af 100644
--- a/tests/issues.rs
+++ b/tests/issues.rs
@@ -117,6 +117,34 @@ fn issue_359() {
}
#[test]
+fn issue_418() {
+ use structopt::StructOpt;
+
+ #[derive(Debug, StructOpt)]
+ struct Opts {
+ #[structopt(subcommand)]
+ /// The command to run
+ command: Command,
+ }
+
+ #[derive(Debug, StructOpt)]
+ enum Command {
+ /// Reticulate the splines
+ #[structopt(visible_alias = "ret")]
+ Reticulate {
+ /// How many splines
+ num_splines: u8,
+ },
+ /// Frobnicate the rest
+ #[structopt(visible_alias = "frob")]
+ Frobnicate,
+ }
+
+ let help = get_long_help::<Opts>();
+ assert!(help.contains("Reticulate the splines [aliases: ret]"));
+}
+
+#[test]
fn issue_490() {
use std::iter::FromIterator;
use std::str::FromStr;
diff --git a/tests/ui/skip_without_default.stderr b/tests/ui/skip_without_default.stderr
index b5d702a..d08be0c 100644
--- a/tests/ui/skip_without_default.stderr
+++ b/tests/ui/skip_without_default.stderr
@@ -1,7 +1,7 @@
error[E0277]: the trait bound `Kind: Default` is not satisfied
- --> $DIR/skip_without_default.rs:22:17
- |
-22 | #[structopt(skip)]
- | ^^^^ the trait `Default` is not implemented for `Kind`
- |
- = note: required by `std::default::Default::default`
+ --> $DIR/skip_without_default.rs:22:17
+ |
+22 | #[structopt(skip)]
+ | ^^^^ the trait `Default` is not implemented for `Kind`
+ |
+note: required by `std::default::Default::default`