Adding log.gd
This commit is contained in:
parent
eb32d6614e
commit
4522259397
547 changed files with 46844 additions and 0 deletions
46
addons/gdUnit4/src/GdUnitGodotErrorAssert.gd
Normal file
46
addons/gdUnit4/src/GdUnitGodotErrorAssert.gd
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
## An assertion tool to verify for Godot runtime errors like assert() and push notifications like push_error().
|
||||
class_name GdUnitGodotErrorAssert
|
||||
extends GdUnitAssert
|
||||
|
||||
|
||||
## Verifies if the executed code runs without any runtime errors
|
||||
## Usage:
|
||||
## [codeblock]
|
||||
## await assert_error(<callable>).is_success()
|
||||
## [/codeblock]
|
||||
func is_success() -> GdUnitGodotErrorAssert:
|
||||
await Engine.get_main_loop().process_frame
|
||||
return self
|
||||
|
||||
|
||||
## Verifies if the executed code runs into a runtime error
|
||||
## Usage:
|
||||
## [codeblock]
|
||||
## await assert_error(<callable>).is_runtime_error(<expected error message>)
|
||||
## [/codeblock]
|
||||
@warning_ignore("unused_parameter")
|
||||
func is_runtime_error(expected_error :String) -> GdUnitGodotErrorAssert:
|
||||
await Engine.get_main_loop().process_frame
|
||||
return self
|
||||
|
||||
|
||||
## Verifies if the executed code has a push_warning() used
|
||||
## Usage:
|
||||
## [codeblock]
|
||||
## await assert_error(<callable>).is_push_warning(<expected push warning message>)
|
||||
## [/codeblock]
|
||||
@warning_ignore("unused_parameter")
|
||||
func is_push_warning(expected_warning :String) -> GdUnitGodotErrorAssert:
|
||||
await Engine.get_main_loop().process_frame
|
||||
return self
|
||||
|
||||
|
||||
## Verifies if the executed code has a push_error() used
|
||||
## Usage:
|
||||
## [codeblock]
|
||||
## await assert_error(<callable>).is_push_error(<expected push error message>)
|
||||
## [/codeblock]
|
||||
@warning_ignore("unused_parameter")
|
||||
func is_push_error(expected_error :String) -> GdUnitGodotErrorAssert:
|
||||
await Engine.get_main_loop().process_frame
|
||||
return self
|
||||
Loading…
Add table
Add a link
Reference in a new issue