X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=tests%2Fenum.qc;h=42853d85ffc3886218c3d24319484c8daea3d890;hp=1691661e62d8d627f14e704524f5888668a98fae;hb=d8d78f61a76bffb96ff70c410312f1434fd98e5a;hpb=73c085a461beef2e33b3a6b7b2b44d1e8e1b087f diff --git a/tests/enum.qc b/tests/enum.qc index 1691661..42853d8 100644 --- a/tests/enum.qc +++ b/tests/enum.qc @@ -1,4 +1,4 @@ -void(string, ...) print = #1;enum { +enum { // this behaviour is confusing, but I like that // we support it. __ = (__ - 1), @@ -33,6 +33,14 @@ enum : flag { F3 /* = 1 << 3 */ }; +/* reversed enumeration */ +enum : reverse { + R1, // 3 + R2, // 2 + R3, // 1 + R4 // 0 +}; + void main() { print(ftos(A), "\n"); print(ftos(B), "\n"); @@ -52,4 +60,9 @@ void main() { print(ftos(F1), "\n"); print(ftos(F2), "\n"); print(ftos(F3), "\n"); + + print(ftos(R1), "\n"); + print(ftos(R2), "\n"); + print(ftos(R3), "\n"); + print(ftos(R4), "\n"); };