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

Function encode_null_violation

nodedb-strict/src/encode.rs:407–421  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

405
406 #[test]
407 fn encode_null_violation() {
408 let schema = crm_schema();
409 let encoder = TupleEncoder::new(&schema);
410
411 let values = vec![
412 Value::Null, // id is NOT NULL
413 Value::String("x".into()),
414 Value::Null,
415 Value::Decimal(rust_decimal::Decimal::ZERO),
416 Value::Null,
417 ];
418
419 let err = encoder.encode(&values).unwrap_err();
420 assert!(matches!(err, StrictError::NullViolation(ref s) if s == "id"));
421 }
422
423 #[test]
424 fn encode_type_mismatch() {

Callers

nothing calls this directly

Calls 2

crm_schemaFunction · 0.70
encodeMethod · 0.45

Tested by

no test coverage detected