#![allow(clippy::used_underscore_binding, clippy::all, warnings, missing_docs)]
#![allow(dead_code)]
#[ allow( unused_imports ) ]
use super::*;
#[ allow( unused_imports ) ]
use test_tools::a_id;
#[ allow( unused_imports ) ]
use collection_tools::HashMap;
#[ derive( Debug, PartialEq, former::Former ) ]
pub struct Child {
name: String,
description: String,
}
#[ derive( Debug, PartialEq, former::Former ) ]
pub struct Parent {
#[ subform_entry ]
command: HashMap< String, Child >,
}
impl former::ValToEntry<HashMap< String, Child >> for Child {
type Entry = (String, Child);
#[ inline( always ) ]
fn val_to_entry(self) -> Self::Entry {
(self.name.clone(), self)
}
}
#[ test ]
fn basic() {
let got = Parent::former()
.command()
.name( "echo" )
.description( "prints all subjects and properties" ) .end()
.command()
.name( "exit" )
.description( "just exit" ) .end()
.form();
a_id!(got.command.len(), 2);
}