add number node
-use crate::lib::RustExpressionEngine::node::{StringNode, Node, ArgNode};
+use crate::lib::RustExpressionEngine::node::{StringNode, Node, ArgNode, NumberNode};
use crate::lib::RustExpressionEngine::node::NodeType::{NString, NArg};
use serde_json::Value;
use serde_json::json;
@@ -60,3 +60,22 @@ fn BenchmarkArgNode() {
time_util::count_time(total, now);
time_util::count_tps(total, now);
}
+
+#[test]
+fn TestNumberNode() {
+ let john = json!({
+ "name": "John Doe",
+ "age": 1,
+ "sex":{
+ "a":"i'm a",
+ "b":"i'm b",
+ },
+ "phones": [
+ "+44 1234567",
+ "+44 2345678"
+ ]
+ });
+ let numb = NumberNode::new(String::from("1.02"));
+ let (value, _) = numb.Eval(&john);
+ println!("{}", value);
+}
\ No newline at end of file
