aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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`