1
0
dust/tests/structs.rs
2024-03-19 19:16:33 -04:00

28 lines
629 B
Rust

use dust_lang::{abstract_tree::Identifier, *};
#[test]
fn simple_structure() {
assert_eq!(
interpret(
"
struct Foo {
bar : int,
baz : str,
}
Foo {
bar = 42,
baz = 'hiya',
}
"
),
Ok(Some(Value::structure(
Identifier::new("Foo"),
vec![
(Identifier::new("bar"), Value::integer(42)),
(Identifier::new("baz"), Value::string("hiya".to_string())),
]
)))
)
}