Skip to main content

codama_nodes/value_nodes/
none_value_node.rs

1use crate::NoneValueNode;
2
3impl NoneValueNode {
4    pub fn new() -> Self {
5        Self::default()
6    }
7}
8
9#[cfg(test)]
10mod tests {
11    use super::*;
12
13    #[test]
14    fn new() {
15        let node = NoneValueNode::new();
16        assert_eq!(node, NoneValueNode {});
17    }
18
19    #[test]
20    fn to_json() {
21        let node = NoneValueNode::new();
22        let json = serde_json::to_string(&node).unwrap();
23        assert_eq!(json, r#"{"kind":"noneValueNode"}"#);
24    }
25
26    #[test]
27    fn from_json() {
28        let json = r#"{"kind":"noneValueNode"}"#;
29        let node: NoneValueNode = serde_json::from_str(json).unwrap();
30        assert_eq!(node, NoneValueNode::new());
31    }
32}