MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / test_directive_with_array

Function test_directive_with_array

aiscript-directive/src/lib.rs:235–247  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

233
234 #[test]
235 fn test_directive_with_array() {
236 let directive = parse_single_directive("@values([1, 2, 3])").unwrap();
237 assert_eq!(directive.name, "values");
238 match directive.params {
239 DirectiveParams::Array(values) => {
240 assert_eq!(values.len(), 3);
241 assert_eq!(values[0], json!(1));
242 assert_eq!(values[1], json!(2));
243 assert_eq!(values[2], json!(3));
244 }
245 _ => panic!("Expected Array parameters"),
246 }
247 }
248
249 #[test]
250 fn test_directive_with_mixed_array() {

Callers

nothing calls this directly

Calls 1

parse_single_directiveFunction · 0.85

Tested by

no test coverage detected