()
| 263 | |
| 264 | #[test] |
| 265 | fn test_directive_with_key_value() { |
| 266 | let directive = parse_single_directive(r#"@validate(min=1, max=10, name="test")"#).unwrap(); |
| 267 | assert_eq!(directive.name, "validate"); |
| 268 | match directive.params { |
| 269 | DirectiveParams::KeyValue(params) => { |
| 270 | assert_eq!(params.len(), 3); |
| 271 | assert_eq!(params.get("min").unwrap(), &json!(1)); |
| 272 | assert_eq!(params.get("max").unwrap(), &json!(10)); |
| 273 | assert_eq!(params.get("name").unwrap(), &json!("test")); |
| 274 | } |
| 275 | _ => panic!("Expected KeyValue parameters"), |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | #[test] |
| 280 | fn test_directive_with_nested_directives() { |
nothing calls this directly
no test coverage detected