FrostyCat
Redemption Seeker
GMAssert
Easy assertion checking for GMS 2.x and 1.4
Overview
GMAssert is a library containing useful assertions for debugging and automated unit testing. You can use it to alert you to undesirable runtime conditions, pause the debugger at that point for further inspection, or quickly test code for expected behaviour.
Downloads
GMS 2.x: YoYo Marketplace | GitHub | Documentation
GMS 1.4: Download | GitHub | Documentation
Examples
Successful Assertion:
This proceeds silently without error messages.
Failed Assertion:
This shows the following error message by default:
Feedback Welcome!
If you have any suggestions for new constructors/use cases or bug reports, please open an issue or contribute on GitHub.
Easy assertion checking for GMS 2.x and 1.4
Overview
GMAssert is a library containing useful assertions for debugging and automated unit testing. You can use it to alert you to undesirable runtime conditions, pause the debugger at that point for further inspection, or quickly test code for expected behaviour.
Downloads
GMS 2.x: YoYo Marketplace | GitHub | Documentation
GMS 1.4: Download | GitHub | Documentation
Examples
Successful Assertion:
Code:
var name = "Alice";
assert_equal(name, "Alice", "Name isn't Alice!");
Code:
var name = "Bob";
assert_equal(name, "Alice", "Name isn't Alice!");
Code:
___________________________________________
############################################################################################
FATAL ERROR in Room Creation Code for room rm_test
Name is wrong!
Expected: (string)
"Alice"
Got: (string)
"Bob"
at gml_Script___gma_assert_error__ (line 11) - show_error(msg, true);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script___gma_assert_error__ (line 11)
called from - gml_Script_assert_equal (line 23) - __gma_assert_error__(msg, argument[1], argument[0]);
called from - gml_Room_rm_test_Create (line 3) - assert_equal(name, "Alice", "Name is wrong!");
Feedback Welcome!
If you have any suggestions for new constructors/use cases or bug reports, please open an issue or contribute on GitHub.
Last edited: