File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
itest/rust/src/builtin_tests/containers Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ fn callable_call_return() {
109
109
callable. callv( & varray![ 10 ] ) ,
110
110
10 . to_variant( ) . stringify( ) . to_variant( )
111
111
) ;
112
- // errors in godot but does not crash
112
+ // Errors in Godot, but should not crash.
113
113
assert_eq ! ( callable. callv( & varray![ "string" ] ) , Variant :: nil( ) ) ;
114
114
}
115
115
@@ -190,6 +190,14 @@ pub mod custom_callable {
190
190
assert_eq ! ( sum3, 0 . to_variant( ) ) ;
191
191
}
192
192
193
+ #[ itest]
194
+ fn callable_custom_with_err ( ) {
195
+ let callable_with_err =
196
+ Callable :: from_fn ( "on_error_doesnt_crash" , |_args : & [ & Variant ] | Err ( ( ) ) ) ;
197
+ // Errors in Godot, but should not crash.
198
+ assert_eq ! ( callable_with_err. callv( & varray![ ] ) , Variant :: nil( ) ) ;
199
+ }
200
+
193
201
#[ itest]
194
202
fn callable_from_fn_eq ( ) {
195
203
let a = Callable :: from_fn ( "sum" , sum) ;
You can’t perform that action at this time.
0 commit comments