Jelajahi Sumber

Fixed enum tests

Brian Fiete 6 bulan lalu
induk
melakukan
295a46237a
1 mengubah file dengan 12 tambahan dan 3 penghapusan
  1. 12 3
      IDEHelper/Tests/src/Enums.bf

+ 12 - 3
IDEHelper/Tests/src/Enums.bf

@@ -123,7 +123,8 @@ namespace Tests
 		{
 			A,
 			B,
-			C
+			C,
+			D = 4
 		}
 
 		[Test]
@@ -292,11 +293,19 @@ namespace Tests
 
 			Test.Assert(sizeof(EnumN) == sizeof(System.Interop.c_int));
 
-			Test.Assert(value.HasFlag(.A) == false);
+			Test.Assert(value.HasFlag(.A) == true);
 			Test.Assert(value.HasFlag(.B) == true);
-
+			Test.Assert(value.HasFlag(.B | .C) == false);
+			Test.Assert(value.HasFlag(.D) == false);
 			Test.Assert(value.Underlying == 1);
 
+			value = .B | .C;
+			Test.Assert(value.HasFlag(.A) == true);
+			Test.Assert(value.HasFlag(.B) == true);
+			Test.Assert(value.HasFlag(.B | .C) == true);
+			Test.Assert(value.HasFlag(.D) == false);
+			Test.Assert(value.Underlying == 3);
+
 			ref System.Interop.c_int valueRef = ref value.UnderlyingRef;
 			valueRef = 2;
 			Test.Assert(value == .C);