File tree 1 file changed +9
-1
lines changed
itest/rust/src/builtin_tests/containers
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ fn callable_call_return() {
115
115
callable. callv( & varray![ 10 ] ) ,
116
116
10 . to_variant( ) . stringify( ) . to_variant( )
117
117
) ;
118
- // errors in godot but does not crash
118
+ // Errors in Godot, but should not crash.
119
119
assert_eq ! ( callable. callv( & varray![ "string" ] ) , Variant :: nil( ) ) ;
120
120
}
121
121
@@ -196,6 +196,14 @@ pub mod custom_callable {
196
196
assert_eq ! ( sum3, 0 . to_variant( ) ) ;
197
197
}
198
198
199
+ #[ itest]
200
+ fn callable_custom_with_err ( ) {
201
+ let callable_with_err =
202
+ Callable :: from_fn ( "on_error_doesnt_crash" , |_args : & [ & Variant ] | Err ( ( ) ) ) ;
203
+ // Errors in Godot, but should not crash.
204
+ assert_eq ! ( callable_with_err. callv( & varray![ ] ) , Variant :: nil( ) ) ;
205
+ }
206
+
199
207
#[ itest]
200
208
fn callable_from_fn_eq ( ) {
201
209
let a = Callable :: from_fn ( "sum" , sum) ;
You can’t perform that action at this time.
0 commit comments