// Copyright 2018 David Roundy // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use auto_args::AutoArgs; #[test] fn simple_phantom() { #[derive(AutoArgs, PartialEq, Debug)] struct PhantomOpt { first: std::marker::PhantomData, second: String, } println!("help: {}", >::help()); assert!(!>::help().contains("--first")); assert!(>::help().contains("--second")); assert_eq!( PhantomOpt:: { first: std::marker::PhantomData, second: "hello".to_string() }, >::from_iter(&["", "--second=hello"]).unwrap() ); assert!(>::from_iter(&[""]).is_err()); }