add get-enum-vals (#737)

This commit is contained in:
water111
2021-08-02 22:01:10 -04:00
committed by GitHub
parent 906db513cd
commit 4d76d2f11a
5 changed files with 58 additions and 1 deletions
@@ -0,0 +1,14 @@
(defenum test-val-enum
(thing1 1)
(thing3 3)
(thing5 5)
)
(defmacro test-enum-vals ()
(let ((enum-list (get-enum-vals 'test-val-enum)))
`(quote ,enum-list)
)
)
(printl (test-enum-vals))
0
+6
View File
@@ -824,6 +824,12 @@ TEST_F(WithGameTests, StackInlineArray) {
"#x30\n0\n"});
}
TEST_F(WithGameTests, GetEnumVals) {
runner.run_static_test(env, testCategory, "test-get-enum-vals.gc",
{"((thing1 . #<invalid object #x1>) (thing3 . #<invalid object #x3>) "
"(thing5 . #<invalid object #x5>))\n0\n"});
}
TEST(TypeConsistency, TypeConsistency) {
Compiler compiler;
compiler.enable_throw_on_redefines();