2024-02-15 01:53:42 +00:00
|
|
|
use dust_lang::*;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn simple_enum() {
|
|
|
|
let result = interpret(
|
|
|
|
"
|
|
|
|
enum Foobar {
|
|
|
|
Foo,
|
|
|
|
Bar,
|
|
|
|
}
|
|
|
|
|
|
|
|
new Foobar:Foo
|
|
|
|
",
|
|
|
|
);
|
|
|
|
|
|
|
|
assert_eq!(
|
|
|
|
result,
|
2024-02-15 03:38:45 +00:00
|
|
|
Ok(Value::Enum(EnumInstance::new(
|
|
|
|
"Foobar".to_string(),
|
|
|
|
"Foo".to_string(),
|
|
|
|
Value::none()
|
|
|
|
)))
|
2024-02-15 01:53:42 +00:00
|
|
|
);
|
|
|
|
}
|