libhaystack 3.2.0

Rust implementation of the Haystack 4 data types, defs, filter, units, and encodings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright (C) 2020 - 2022, J2 Innovations

//! Test XStr

#[cfg(test)]
use libhaystack::val::*;

#[test]
fn test_xstr_make_value() {
    let xstr = XStr::make("type", "value");

    let value: Value = xstr.into();

    assert!(value.is_xstr());
    assert!(!value.is_symbol());

    assert_eq!(XStr::try_from(&value), Ok(XStr::make("type", "value")));
}