We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 626a43b + dd5db94 commit 08af2e5Copy full SHA for 08af2e5
src/lib.rs
@@ -2006,4 +2006,16 @@ Options:
2006
let mut opts = Options::new();
2007
opts.optflag("", "a", "Oops, long option too short");
2008
}
2009
+
2010
+ #[test]
2011
+ #[should_panic]
2012
+ fn test_undefined_opt_present() {
2013
+ let mut opts = Options::new();
2014
+ opts.optflag("h", "help", "Description");
2015
+ let args = vec!["-h"];
2016
+ match opts.parse(args) {
2017
+ Ok(matches) => assert!(!matches.opt_present("undefined")),
2018
+ Err(e) => panic!("{}", e)
2019
+ }
2020
2021
0 commit comments