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 {
2929 //($($args:tt),* $(,)?) => {
3030 unsafe {
3131 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.
3333
3434 // Check whether engine is loaded, otherwise fall back to stderr.
3535 if $crate:: sys:: is_initialized( ) {
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ fn dynamic_call_with_panic() {
163163
164164 let expected_error_message = "godot-rust function call failed: Object::call(&\" do_panic\" )\
165165 \n Source: ObjPayload::do_panic()\
166- \n Reason: function panicked: do_panic exploded"
166+ \n Reason: function panicked: do_panic exploded 💥 "
167167 . to_string ( ) ;
168168
169169 assert_eq ! ( call_error. to_string( ) , expected_error_message) ;
@@ -188,9 +188,9 @@ fn dynamic_call_with_panic() {
188188 // In Debug, there is a context -> message is multi-line -> '\n' is inserted after [panic ...].
189189 // In Release, simpler message -> single line -> no '\n'.
190190 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}" )
192192 } else {
193- format ! ( "[panic {path}:{line}] do_panic exploded" )
193+ format ! ( "[panic {path}:{line}] do_panic exploded 💥 " )
194194 } ;
195195
196196 assert_eq ! ( panic_message, expected_panic_message) ;
Original file line number Diff line number Diff line change @@ -907,7 +907,8 @@ impl ObjPayload {
907907
908908 #[ func]
909909 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 💥" ) ;
911912 }
912913
913914 // 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