File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -719,13 +719,19 @@ fn test_display_ident() {
719719#[ test]
720720fn test_debug_ident ( ) {
721721 let ident = Ident :: new ( "proc_macro" , Span :: call_site ( ) ) ;
722+ let expected = if cfg ! ( span_locations) {
723+ "Ident { sym: proc_macro }"
724+ } else {
725+ "Ident(proc_macro)"
726+ } ;
727+ assert_eq ! ( expected, format!( "{:?}" , ident) ) ;
722728
723- # [ cfg ( not ( span_locations ) ) ]
724- let expected = "Ident(proc_macro)" ;
725-
726- # [ cfg ( span_locations ) ]
727- let expected = "Ident { sym: proc_macro }" ;
728-
729+ let ident = Ident :: new_raw ( "proc_macro" , Span :: call_site ( ) ) ;
730+ let expected = if cfg ! ( span_locations ) {
731+ "Ident { sym: r#proc_macro }"
732+ } else {
733+ "Ident(r# proc_macro)"
734+ } ;
729735 assert_eq ! ( expected, format!( "{:?}" , ident) ) ;
730736}
731737
You can’t perform that action at this time.
0 commit comments