File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -645,3 +645,31 @@ fn test_point_to_double_width_characters_multiple() {
645645
646646 assert_eq ! ( DisplayList :: from( snippets) . to_string( ) , expected) ;
647647}
648+
649+ #[ test]
650+ fn test_point_to_double_width_characters_mixed ( ) {
651+ let snippets = Snippet {
652+ slices : vec ! [ snippet:: Slice {
653+ source: "こんにちは、新しいWorld!" ,
654+ line_start: 1 ,
655+ origin: Some ( "<current file>" ) ,
656+ annotations: vec![ snippet:: SourceAnnotation {
657+ range: ( 6 , 14 ) ,
658+ label: "New world" ,
659+ annotation_type: snippet:: AnnotationType :: Error ,
660+ } ] ,
661+ fold: false ,
662+ } ] ,
663+ title : None ,
664+ footer : vec ! [ ] ,
665+ opt : Default :: default ( ) ,
666+ } ;
667+
668+ let expected = r#" --> <current file>:1:7
669+ |
670+ 1 | こんにちは、新しいWorld!
671+ | ^^^^^^^^^^^ New world
672+ |"# ;
673+
674+ assert_eq ! ( DisplayList :: from( snippets) . to_string( ) , expected) ;
675+ }
You can’t perform that action at this time.
0 commit comments