MCPcopy Create free account
hub / github.com/cosdata/cosdata / test_extend_entity_inference_parser

Function test_extend_entity_inference_parser

src/cosql/inference/extend_entity.rs:30–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28
29 #[test]
30 fn test_extend_entity_inference_parser() {
31 let values = [
32 (
33 "extend $person1 (
34 salary: 100000
35 )",
36 ExtendEntityInference {
37 variable: "person1".to_string(),
38 attributes: vec![Attribute {
39 name: "salary".to_string(),
40 value: Value::Int(100000),
41 }],
42 },
43 ),
44 (
45 "extend $city1 (
46 visitors: $visitors
47 )",
48 ExtendEntityInference {
49 variable: "city1".to_string(),
50 attributes: vec![Attribute {
51 name: "visitors".to_string(),
52 value: Value::Variable("visitors".to_string()),
53 }],
54 },
55 ),
56 ];
57
58 for (source, expected) in values {
59 let (_, parsed) = parse_extend_entity_inference(source).unwrap();
60
61 assert_eq!(parsed, expected);
62 }
63 }
64}

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected