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

Function test_attribute_parser

src/cosql/insertion/mod.rs:61–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59
60 #[test]
61 fn test_attribute_parser() {
62 let values = [
63 (
64 r#"name: "The Rust Dev""#,
65 Attribute {
66 name: "name".to_string(),
67 value: Value::String("The Rust Dev".to_string()),
68 },
69 ),
70 (
71 "age: 54",
72 Attribute {
73 name: "age".to_string(),
74 value: Value::Int(54),
75 },
76 ),
77 (
78 "date_of_birth: 01-01-1970",
79 Attribute {
80 name: "date_of_birth".to_string(),
81 value: Value::Date(Date(1, 1, 1970)),
82 },
83 ),
84 ];
85
86 for (source, expected) in values {
87 let (_, parsed) = parse_attribute(source).unwrap();
88
89 assert_eq!(parsed, expected);
90 }
91 }
92
93 #[test]
94 fn test_attributes_parser() {

Callers

nothing calls this directly

Calls 2

DateClass · 0.85
parse_attributeFunction · 0.85

Tested by

no test coverage detected