24 lines
431 B
Rust
24 lines
431 B
Rust
use dust_lang::{identifier::Identifier, *};
|
|
|
|
#[test]
|
|
fn simple_enum() {
|
|
assert_eq!(
|
|
interpret(
|
|
"test",
|
|
"
|
|
type FooBar = enum {
|
|
Foo,
|
|
Bar,
|
|
}
|
|
|
|
FooBar::Foo
|
|
"
|
|
),
|
|
Ok(Some(Value::enum_instance(
|
|
Identifier::new("FooBar"),
|
|
Identifier::new("Foo"),
|
|
None
|
|
)))
|
|
);
|
|
}
|