@@ -339,15 +339,35 @@ fn tr_d_space_n() {
339
339
546869732069732061207375697465206f6620527573742d6e617469766520636f726520636f6d6d616e64206c696e65207574696c74696573202863702c206d762c0a61776b2c206d616b652c2076692c202e2e2e29207573696e6720504f5349582e323032342061732074686520626173656c696e652073706563696669636174696f6e2e0a\
340
340
";
341
341
342
- tr_test ( & [ "-d" , r# " \n"# ] , input, output) ;
342
+ tr_test ( & [ "-d" , r" \n" ] , input, output) ;
343
343
}
344
344
345
345
#[ test]
346
346
fn tr_ignored_backslash ( ) {
347
- tr_test ( & [ "-d" , r# "\z"# ] , "xyz" , "xy" ) ;
347
+ tr_test ( & [ "-d" , r"\z" ] , "xyz" , "xy" ) ;
348
348
}
349
349
350
350
#[ test]
351
351
fn tr_escaped_backslash ( ) {
352
- tr_test ( & [ "-d" , r#"\\"# ] , r#"a\b\c"# , "abc" ) ;
352
+ tr_test ( & [ "-d" , r"\\" ] , r"a\b\c" , "abc" ) ;
353
+ }
354
+
355
+ #[ test]
356
+ fn tr_octal_sequence ( ) {
357
+ tr_test ( & [ "2" , r"\44" ] , "123\n " , "1$3\n " ) ;
358
+ }
359
+
360
+ #[ test]
361
+ fn tr_octal_sequence_two ( ) {
362
+ tr_test ( & [ "21" , r"\44Z" ] , "123123\n " , "Z$3Z$3\n " ) ;
363
+ }
364
+
365
+ #[ test]
366
+ fn tr_reverse_order_simple ( ) {
367
+ tr_test ( & [ "21" , "AB" ] , "12\n " , "BA\n " ) ;
368
+ }
369
+
370
+ #[ test]
371
+ fn tr_duplicate_string1_character_precedence ( ) {
372
+ tr_test ( & [ "AA" , "CB" ] , "AAAA" , "BBBB" ) ;
353
373
}
0 commit comments