add tests for the api

This commit is contained in:
2026-01-01 12:13:05 -05:00
parent 4aa86da14a
commit d3b882f56d
12 changed files with 739 additions and 42 deletions

View File

@@ -149,3 +149,22 @@ fn test_generic_command() {
.unwrap();
assert_eq!(result.a, true);
}
#[test]
fn test_unit_command() {
#[derive(IntoCommandDefinition)]
struct TestStruct;
let command_definition = TestStruct::create("Test".to_string());
assert_eq!(command_definition.name, "Test");
assert_eq!(command_definition.parameters.capacity(), 0);
TestStruct::parse(Command {
header: CommandHeader {
timestamp: Default::default(),
},
parameters: HashMap::new(),
})
.unwrap();
}