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

Function test_value_parser

src/cosql/value.rs:81–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79
80 #[test]
81 fn test_value_parser() {
82 let values = [
83 (r#""Hello, Rust""#, Value::String("Hello, Rust".to_string())),
84 ("23", Value::Int(23)),
85 ("-756", Value::Int(-756)),
86 ("2345.12", Value::Double(2345.12)),
87 ("-765.2", Value::Double(-765.2)),
88 ("11-8-2024", Value::Date(Date(11, 8, 2024))),
89 ("true", Value::Boolean(true)),
90 ("false", Value::Boolean(false)),
91 ("$var_name", Value::Variable("var_name".to_string())),
92 ];
93
94 for (source, expected) in values {
95 let (_, parsed) = parse_value(source).unwrap();
96
97 assert_eq!(parsed, expected);
98 }
99 }
100}

Callers

nothing calls this directly

Calls 2

DateClass · 0.85
parse_valueFunction · 0.85

Tested by

no test coverage detected