File tree 1 file changed +11
-0
lines changed
src/test/ui/proc-macro/auxiliary/api
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,17 @@ fn test_display_literal() {
18
18
Literal :: f64_unsuffixed( 1e100 ) . to_string( ) ,
19
19
"10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0" ,
20
20
) ;
21
+
22
+ assert_eq ! (
23
+ Literal :: string( "a \t ❤ ' \" \u{1} " ) . to_string( ) ,
24
+ "\" a \\ t ❤ \\ ' \\ \" \\ u{1}\" " ,
25
+ ) ;
26
+ assert_eq ! ( Literal :: character( 'a' ) . to_string( ) , "'\\ u{61}'" ) ;
27
+ assert_eq ! ( Literal :: character( '\t' ) . to_string( ) , "'\\ u{9}'" ) ;
28
+ assert_eq ! ( Literal :: character( '❤' ) . to_string( ) , "'\\ u{2764}'" ) ;
29
+ assert_eq ! ( Literal :: character( '\'' ) . to_string( ) , "'\\ u{27}'" ) ;
30
+ assert_eq ! ( Literal :: character( '"' ) . to_string( ) , "'\\ u{22}'" ) ;
31
+ assert_eq ! ( Literal :: character( '\u{1}' ) . to_string( ) , "'\\ u{1}'" ) ;
21
32
}
22
33
23
34
fn test_parse_literal ( ) {
You can’t perform that action at this time.
0 commit comments