File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
itest/rust/src/object_tests Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ macro_rules! inner_godot_msg {
29
29
//($($args:tt),* $(,)?) => {
30
30
unsafe {
31
31
let msg = format!( "{}\0 " , format_args!( $fmt $( , $args) * ) ) ;
32
- // assert!(msg.is_ascii(), "godot_error: message must be ASCII");
32
+ // Godot supports Unicode messages, not only ASCII. See `do_panic` test.
33
33
34
34
// Check whether engine is loaded, otherwise fall back to stderr.
35
35
if $crate:: sys:: is_initialized( ) {
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ fn dynamic_call_with_panic() {
163
163
164
164
let expected_error_message = "godot-rust function call failed: Object::call(&\" do_panic\" )\
165
165
\n Source: ObjPayload::do_panic()\
166
- \n Reason: function panicked: do_panic exploded"
166
+ \n Reason: function panicked: do_panic exploded 💥 "
167
167
. to_string ( ) ;
168
168
169
169
assert_eq ! ( call_error. to_string( ) , expected_error_message) ;
@@ -188,9 +188,9 @@ fn dynamic_call_with_panic() {
188
188
// In Debug, there is a context -> message is multi-line -> '\n' is inserted after [panic ...].
189
189
// In Release, simpler message -> single line -> no '\n'.
190
190
let expected_panic_message = if cfg ! ( debug_assertions) {
191
- format ! ( "[panic {path}:{line}]\n do_panic exploded{context}" )
191
+ format ! ( "[panic {path}:{line}]\n do_panic exploded 💥 {context}" )
192
192
} else {
193
- format ! ( "[panic {path}:{line}] do_panic exploded" )
193
+ format ! ( "[panic {path}:{line}] do_panic exploded 💥 " )
194
194
} ;
195
195
196
196
assert_eq ! ( panic_message, expected_panic_message) ;
Original file line number Diff line number Diff line change @@ -907,7 +907,8 @@ impl ObjPayload {
907
907
908
908
#[ func]
909
909
fn do_panic ( & self ) {
910
- panic ! ( "do_panic exploded" ) ;
910
+ // Unicode character as regression test for https://github.com/godot-rust/gdext/issues/384.
911
+ panic ! ( "do_panic exploded 💥" ) ;
911
912
}
912
913
913
914
// Obtain the line number of the panic!() call above; keep equidistant to do_panic() method.
You can’t perform that action at this time.
0 commit comments