MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / unknown_field_errors

Function unknown_field_errors

nodedb/src/data/executor/strict_format/coerce.rs:449–464  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

447
448 #[test]
449 fn unknown_field_errors() {
450 let schema = test_schema();
451 let mut map = std::collections::HashMap::new();
452 map.insert("id".into(), Value::String("u4".into()));
453 map.insert("name".into(), Value::String("Eve".into()));
454 map.insert("extra".into(), Value::String("boom".into()));
455
456 let result = super::super::encode::value_to_binary_tuple(&Value::Object(map), &schema);
457 assert!(result.is_err());
458 assert!(
459 result
460 .unwrap_err()
461 .to_string()
462 .contains("unknown field 'extra'")
463 );
464 }
465}

Callers

nothing calls this directly

Calls 3

value_to_binary_tupleFunction · 0.85
test_schemaFunction · 0.70
insertMethod · 0.45

Tested by

no test coverage detected