File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -608,3 +608,40 @@ fn test_point_to_double_width_characters_across_lines() {
608608
609609 assert_eq ! ( DisplayList :: from( snippets) . to_string( ) , expected) ;
610610}
611+
612+ #[ test]
613+ fn test_point_to_double_width_characters_multiple ( ) {
614+ let snippets = Snippet {
615+ slices : vec ! [ snippet:: Slice {
616+ source: "お寿司\n 食べたい🍣" ,
617+ line_start: 1 ,
618+ origin: Some ( "<current file>" ) ,
619+ annotations: vec![
620+ snippet:: SourceAnnotation {
621+ range: ( 0 , 3 ) ,
622+ label: "Sushi1" ,
623+ annotation_type: snippet:: AnnotationType :: Error ,
624+ } ,
625+ snippet:: SourceAnnotation {
626+ range: ( 6 , 8 ) ,
627+ label: "Sushi2" ,
628+ annotation_type: snippet:: AnnotationType :: Note ,
629+ } ,
630+ ] ,
631+ fold: false ,
632+ } ] ,
633+ title : None ,
634+ footer : vec ! [ ] ,
635+ opt : Default :: default ( ) ,
636+ } ;
637+
638+ let expected = r#" --> <current file>:1:1
639+ |
640+ 1 | お寿司
641+ | ^^^^^^ Sushi1
642+ 2 | 食べたい🍣
643+ | ---- note: Sushi2
644+ |"# ;
645+
646+ assert_eq ! ( DisplayList :: from( snippets) . to_string( ) , expected) ;
647+ }
You can’t perform that action at this time.
0 commit comments