mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
Merge #2980
2980: test: Easier to test with minimal features r=pksunkara a=epage Co-authored-by: Ed Page <eopage@gmail.com>
This commit is contained in:
commit
acaa3645c3
3 changed files with 4 additions and 6 deletions
|
@ -39,7 +39,7 @@ heck = "0.3.0"
|
|||
proc-macro-error = "1"
|
||||
|
||||
[dev-dependencies]
|
||||
clap = { path = "../" }
|
||||
clap = { path = "../", default-features = false, features = ["std", "derive", "env"] }
|
||||
trybuild = "1.0"
|
||||
rustversion = "1"
|
||||
version-sync = "0.9"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use clap::{AppSettings, Args, ColorChoice, IntoApp, Parser, Subcommand};
|
||||
use clap::{AppSettings, Args, IntoApp, Parser, Subcommand};
|
||||
|
||||
#[test]
|
||||
fn arg_help_heading_applied() {
|
||||
|
@ -191,7 +191,7 @@ fn flatten_field_with_help_heading() {
|
|||
#[test]
|
||||
fn derive_generated_error_has_full_context() {
|
||||
#[derive(Debug, Parser)]
|
||||
#[clap(setting(AppSettings::SubcommandsNegateReqs), color = ColorChoice::Never)]
|
||||
#[clap(setting(AppSettings::SubcommandsNegateReqs))]
|
||||
struct Opts {
|
||||
#[clap(long)]
|
||||
req_str: String,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
mod utils;
|
||||
|
||||
use clap::{App, Arg, ColorChoice, Error, ErrorKind};
|
||||
use clap::{App, Arg, Error, ErrorKind};
|
||||
|
||||
fn compare_error(
|
||||
err: Error,
|
||||
|
@ -52,8 +52,6 @@ For more information try --help
|
|||
.long("no-git-push")
|
||||
.about("Do not push generated commit and tags to git remote"),
|
||||
);
|
||||
#[cfg(feature = "color")]
|
||||
let app = app.color(ColorChoice::Never);
|
||||
let mut app = app;
|
||||
let expected_kind = ErrorKind::InvalidValue;
|
||||
let err = app.error(expected_kind, "Failed for mysterious reasons");
|
||||
|
|
Loading…
Reference in a new issue