// 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. #[macro_use] extern crate clapme; use clapme::ClapMe; #[test] fn simple_phantom() { #[derive(ClapMe, PartialEq, Debug)] struct PhantomOpt { first: std::marker::PhantomData, second: String, } println!("help: {}", >::help_message("foo")); assert!(!>::help_message("foo").contains("--first")); assert!(>::help_message("foo").contains("--second")); assert_eq!( PhantomOpt:: { first: std::marker::PhantomData, second: "hello".to_string() }, >::from_iter(&["","--second=hello"]).unwrap()); assert!(>::from_iter(&[""]).is_err()); }