1
0
dust/tests/structure.rs

15 lines
338 B
Rust
Raw Normal View History

2024-01-06 07:26:51 +00:00
use std::collections::BTreeMap;
use dust_lang::*;
#[test]
fn simple_structure() {
let result = interpret("struct { x <int> = 0 }");
let mut btree_map = BTreeMap::new();
btree_map.insert("x".to_string(), (Some(Value::Integer(0)), Type::Integer));
2024-01-06 08:47:54 +00:00
assert_eq!(Ok(Value::Structure(Structure::new(btree_map))), result);
2024-01-06 07:26:51 +00:00
}