File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -202,8 +202,18 @@ mod tests {
202202 ) ]
203203 fn test_debug ( ) {
204204 let thread = NSThread :: main ( ) ;
205- let expected = format ! ( "<NSThread: {:p}>{{number = 1, name = (null)}}" , thread) ;
206- assert_eq ! ( format!( "{:?}" , thread) , expected) ;
205+
206+ let actual = format ! ( "{:?}" , thread) ;
207+ let expected_macos_11 = format ! ( "<NSThread: {:p}>{{number = 1, name = (null)}}" , thread) ;
208+ let expected_macos_12 =
209+ format ! ( "<_NSMainThread: {:p}>{{number = 1, name = (null)}}" , thread) ;
210+ assert ! (
211+ actual == expected_macos_11 || actual == expected_macos_12,
212+ "Expected one of {:?} or {:?}, got {:?}" ,
213+ expected_macos_11,
214+ expected_macos_12,
215+ actual,
216+ ) ;
207217
208218 // SAFETY: We don't use the marker for anything other than its Debug
209219 // impl, so this test doesn't actually need to run on the main thread!
Original file line number Diff line number Diff line change 8181 id b;
8282 void (*c)(void );
8383};
84- ENCODING (STRUCT_WITH_BLOCK, struct with_block);
84+ ENCODING_INNER (STRUCT_WITH_BLOCK, struct with_block); \
85+ ENCODING_INNER (STRUCT_WITH_BLOCK_POINTER, struct with_block*); \
8586
8687struct with_atomic_inner {
8788 _Atomic int a;
Original file line number Diff line number Diff line change @@ -239,7 +239,6 @@ const WITH_BLOCK: Encoding<'static> = Encoding::Struct(
239239) ;
240240assert_inner ! ( str ENCODING_STRUCT_WITH_BLOCK => WITH_BLOCK ) ;
241241assert_inner ! ( str ENCODING_STRUCT_WITH_BLOCK_POINTER => Encoding :: Pointer ( & WITH_BLOCK ) ) ;
242- assert_inner ! ( str ENCODING_STRUCT_WITH_BLOCK_ATOMIC => "A{with_block}" ) ;
243242
244243assert_inner ! ( str ENCODING_STRUCT_WITH_ATOMIC => "{with_atomic=Ai^Ai{with_atomic_inner=Ai^Ai}^{with_atomic_inner}^A{with_atomic_inner}}" ) ;
245244assert_inner ! ( str ENCODING_STRUCT_WITH_ATOMIC_POINTER => "^{with_atomic=Ai^Ai{with_atomic_inner=Ai^Ai}^{with_atomic_inner}^A{with_atomic_inner}}" ) ;
You can’t perform that action at this time.
0 commit comments