~extremepopcorn/dhlib/dhlib_ep

« back to all changes in this revision

Viewing changes to haxe/EnumFields.hx

  • Committer: edA-qa mort-ora-y
  • Date: 2010-02-16 05:36:32 UTC
  • Revision ID: eda-qa@disemia.com-20100216053632-60lt7fndfi3fgblw
first

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* <license>
 
2
 * This file is part of the dis-Emi-A HaXe Library. Copyright (c) edA-qa mort-ora-y
 
3
 * For full copyright and license information please refer to doc/license.txt.
 
4
 * </license> 
 
5
 */
 
6
enum Fields
 
7
{
 
8
        One;
 
9
        Two;
 
10
        Three;
 
11
}
 
12
 
 
13
class EnumFields  extends haxe.unit.TestCase
 
14
{
 
15
        public function testMain()
 
16
        {
 
17
                var all = new Hash<Bool>();
 
18
                var c = 0;
 
19
                for(i in Type.getEnumConstructs(Fields))
 
20
                {
 
21
                        all.set( i, true );
 
22
                        c++;
 
23
                }
 
24
                        
 
25
                assertTrue( all.get( "One" ) );
 
26
                assertTrue( all.get( "Two" ) );
 
27
                assertTrue( all.get( "Three" ) );
 
28
                assertEquals( 3, c );
 
29
        }
 
30
}