From 295a46237ad07d21762edcb9b302d5570fc7af1b Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 17 Mar 2025 13:05:38 -0400 Subject: [PATCH] Fixed enum tests --- IDEHelper/Tests/src/Enums.bf | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/IDEHelper/Tests/src/Enums.bf b/IDEHelper/Tests/src/Enums.bf index 07a12cbd..8309ee11 100644 --- a/IDEHelper/Tests/src/Enums.bf +++ b/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);