-
Notifications
You must be signed in to change notification settings - Fork 1
test.error catcher
load test.error-catcher
This module provides the Test.ErrorCatcher class which provides a context to manage runtime error conversion to exception.
This class provides a context to manage runtime error conversion to exception. All runtime errors reached with an instance of Test.ErrorCatcher active will automaticaly be converted into Test.RuntimeError and raised.
Test code can then catch the Test.RuntimeError to perform tests.
Example:
try {
let catcher = Test.ErrorCatcher()
1 % 0
} catch error {
self.expectEquel('Test.RuntimeError', typeof error)
self.expectEquel('modulo by zero', error.toString())
}
| Modifiers | Member | Description |
|---|---|---|
const |
new | Creates a new context. |
| Modifiers | Member | Description |
|---|---|---|
final |
d_ptr | Internal context. |
@ const
|
g_lib | Global library handle. |
This class provides the context of a runtime error catched by an instance of Test.ErrorCatcher.
| Modifiers | Member | Description |
|---|---|---|
const |
new | Creates a new context. The message parameter provides the runtime error message. |
const |
toString | Returns the runtime error message. |
| Modifiers | Member | Description |
|---|---|---|
final |
message | Internal error mesage. |
null
Internal context.
lib ('libmint-test')
Global library handle.
def (self)
Creates a new context.
none
Internal error mesage.
def (self, message)
Creates a new context. The message parameter provides the runtime
error message.
def (const self)
Returns the runtime error message.
- Introduction
- Variables
-
Built-in-types
- Built-in-types#none
- Built-in-types#null
- Built-in-types#boolean
- Built-in-types#number
- Built-in-types#string
- Built-in-types#regex
- Built-in-types#array
- Built-in-types#hash
- Built-in-types#iterator
- Built-in-types#async_iterator
- Built-in-types#package
- Built-in-types#function
- Built-in-types#coroutine
- Built-in-types#library
- Built-in-types#libobject
- Arithmetic-operations
- Type-casting
- Control-structures
- Function-definition
- User-defined-types
- Work-with-modules