From a89e744ed0e8c759caf041a580112365bbfe4303 Mon Sep 17 00:00:00 2001 From: radiohotline Date: Tue, 25 Aug 2026 16:33:56 +0300 Subject: escoria update --- addons/gdUnit4/src/GdUnitAssert.gd | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 addons/gdUnit4/src/GdUnitAssert.gd (limited to 'addons/gdUnit4/src/GdUnitAssert.gd') diff --git a/addons/gdUnit4/src/GdUnitAssert.gd b/addons/gdUnit4/src/GdUnitAssert.gd new file mode 100644 index 0000000..41382d9 --- /dev/null +++ b/addons/gdUnit4/src/GdUnitAssert.gd @@ -0,0 +1,47 @@ +## Base interface of all GdUnit asserts +@abstract class_name GdUnitAssert +extends RefCounted + + +## Verifies that the current value is null. +@abstract func is_null() -> GdUnitAssert + + +## Verifies that the current value is not null. +@abstract func is_not_null() -> GdUnitAssert + + +## Verifies that the current value is equal to expected one. +@abstract func is_equal(expected: Variant) -> GdUnitAssert + + +## Verifies that the current value is not equal to expected one. +@abstract func is_not_equal(expected: Variant) -> GdUnitAssert + + +## Overrides the default failure message by given custom message.[br] +## This function allows you to replace the automatically generated failure message with a more specific +## or user-friendly message that better describes the test failure context.[br] +## Usage: +## [codeblock] +## # Override with custom context-specific message +## func test_player_inventory(): +## assert_that(player.get_item_count("sword"))\ +## .override_failure_message("Player should have exactly one sword")\ +## .is_equal(1) +## [/codeblock] +@abstract func override_failure_message(message: String) -> GdUnitAssert + + +## Appends a custom message to the failure message.[br] +## This can be used to add additional information to the generated failure message +## while keeping the original assertion details for better debugging context.[br] +## Usage: +## [codeblock] +## # Add context to existing failure message +## func test_player_health(): +## assert_that(player.health)\ +## .append_failure_message("Player was damaged by: %s" % last_damage_source)\ +## .is_greater(0) +## [/codeblock] +@abstract func append_failure_message(message: String) -> GdUnitAssert -- cgit v1.3