Because GdUnit4 uses unhandled exceptions to report failure, any failure that happens inside a universal exception handler never gets recognized.
Steps to Reproduce
Here is a test suite that fails in the appropriate way:
using GdUnit4;
using static GdUnit4.Assertions;
[TestSuite]
public class ExampleTest
{
[TestCase]
public void Failure()
{
AssertBool(false).IsTrue();
}
}
Here is a test case that "succeeds", even though it shouldn't:
using System;
using GdUnit4;
using static GdUnit4.Assertions;
[TestSuite]
public class ExampleTest
{
[TestCase]
public void Failure()
{
try
{
AssertBool(false).IsTrue();
}
catch (Exception e)
{
}
}
}
This makes it extremely difficult to test code inside exception handlers.
Why you use a try catch block around the assertion?
This is not common to use assertions, when you catch an exception without propagation the test will never fail.
That is an expected behavior.
The used GdUnit4 version
4.3.2 (Latest Release)
The used Godot version
v4.2.2 (custom)
Operating System
Manjaro Linux
Describe the bug
Because GdUnit4 uses unhandled exceptions to report failure, any failure that happens inside a universal exception handler never gets recognized.
Steps to Reproduce
Here is a test suite that fails in the appropriate way:
Here is a test case that "succeeds", even though it shouldn't:
This makes it extremely difficult to test code inside exception handlers.
Minimal reproduction project
No response