in fastpay_core/src/generate_format.rs [43:62]
fn main() {
let options = Options::from_args();
let registry = get_registry().unwrap();
match options.action {
Action::Print => {
let content = serde_yaml::to_string(®istry).unwrap();
println!("{}", content);
}
Action::Record => {
let content = serde_yaml::to_string(®istry).unwrap();
let mut f = File::create(FILE_PATH).unwrap();
writeln!(f, "{}", content).unwrap();
}
Action::Test => {
let reference = std::fs::read_to_string(FILE_PATH).unwrap();
let content = serde_yaml::to_string(®istry).unwrap() + "\n";
similar_asserts::assert_str_eq!(&reference, &content);
}
}
}