File: Main.hx

package info (click to toggle)
haxe 1%3A3.2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 23,464 kB
  • ctags: 9,612
  • sloc: ml: 83,200; ansic: 1,724; makefile: 473; java: 349; cs: 314; python: 250; sh: 43; cpp: 39; xml: 25
file content (22 lines) | stat: -rw-r--r-- 698 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Main
{
	public static function main()
	{
		var asm = cs.system.reflection.Assembly.LoadFile(sys.FileSystem.fullPath("bin/lib1/bin/lib1.dll"));
		var name = #if no_root "haxe.root.Lib1" #else "Lib1" #end;
		var tp:Dynamic = asm.GetType(name);
		var obj = tp.test();
		trace(obj);
		for (field in Reflect.fields(obj))
		{
			var val:Dynamic = Reflect.field(obj,field);
			if (val != true)
				throw 'Value $val for field $field';
		}
		var names = ["longInexistentName","otherName","yetAnotherName","fdskljdflskjf","xxy"];
		var n2 = Reflect.fields(obj);
		names.sort(Reflect.compare);
		n2.sort(Reflect.compare);
		if (names.toString() != n2.toString()) throw 'Mismatch: $names and $n2';
	}
}