1
- use annotate_snippets:: renderer:: Renderer ;
2
- use annotate_snippets:: snippet:: { self , Snippet } ;
1
+ use annotate_snippets:: { Annotation , AnnotationType , Renderer , Slice , Snippet , SourceAnnotation } ;
3
2
4
3
#[ test]
5
4
fn test_i_29 ( ) {
6
5
let snippets = Snippet {
7
- title : Some ( snippet :: Annotation {
6
+ title : Some ( Annotation {
8
7
id : None ,
9
8
label : Some ( "oops" ) ,
10
- annotation_type : snippet :: AnnotationType :: Error ,
9
+ annotation_type : AnnotationType :: Error ,
11
10
} ) ,
12
11
footer : vec ! [ ] ,
13
- slices : vec ! [ snippet :: Slice {
12
+ slices : vec ! [ Slice {
14
13
source: "First line\r \n Second oops line" ,
15
14
line_start: 1 ,
16
15
origin: Some ( "<current file>" ) ,
17
- annotations: vec![ snippet :: SourceAnnotation {
16
+ annotations: vec![ SourceAnnotation {
18
17
range: ( 19 , 23 ) ,
19
18
label: "oops" ,
20
- annotation_type: snippet :: AnnotationType :: Error ,
19
+ annotation_type: AnnotationType :: Error ,
21
20
} ] ,
22
21
fold: true ,
23
22
} ] ,
@@ -37,14 +36,14 @@ fn test_i_29() {
37
36
#[ test]
38
37
fn test_point_to_double_width_characters ( ) {
39
38
let snippets = Snippet {
40
- slices : vec ! [ snippet :: Slice {
39
+ slices : vec ! [ Slice {
41
40
source: "こんにちは、世界" ,
42
41
line_start: 1 ,
43
42
origin: Some ( "<current file>" ) ,
44
- annotations: vec![ snippet :: SourceAnnotation {
43
+ annotations: vec![ SourceAnnotation {
45
44
range: ( 6 , 8 ) ,
46
45
label: "world" ,
47
- annotation_type: snippet :: AnnotationType :: Error ,
46
+ annotation_type: AnnotationType :: Error ,
48
47
} ] ,
49
48
fold: false ,
50
49
} ] ,
@@ -65,14 +64,14 @@ fn test_point_to_double_width_characters() {
65
64
#[ test]
66
65
fn test_point_to_double_width_characters_across_lines ( ) {
67
66
let snippets = Snippet {
68
- slices : vec ! [ snippet :: Slice {
67
+ slices : vec ! [ Slice {
69
68
source: "おはよう\n ございます" ,
70
69
line_start: 1 ,
71
70
origin: Some ( "<current file>" ) ,
72
- annotations: vec![ snippet :: SourceAnnotation {
71
+ annotations: vec![ SourceAnnotation {
73
72
range: ( 2 , 8 ) ,
74
73
label: "Good morning" ,
75
- annotation_type: snippet :: AnnotationType :: Error ,
74
+ annotation_type: AnnotationType :: Error ,
76
75
} ] ,
77
76
fold: false ,
78
77
} ] ,
@@ -95,20 +94,20 @@ fn test_point_to_double_width_characters_across_lines() {
95
94
#[ test]
96
95
fn test_point_to_double_width_characters_multiple ( ) {
97
96
let snippets = Snippet {
98
- slices : vec ! [ snippet :: Slice {
97
+ slices : vec ! [ Slice {
99
98
source: "お寿司\n 食べたい🍣" ,
100
99
line_start: 1 ,
101
100
origin: Some ( "<current file>" ) ,
102
101
annotations: vec![
103
- snippet :: SourceAnnotation {
102
+ SourceAnnotation {
104
103
range: ( 0 , 3 ) ,
105
104
label: "Sushi1" ,
106
- annotation_type: snippet :: AnnotationType :: Error ,
105
+ annotation_type: AnnotationType :: Error ,
107
106
} ,
108
- snippet :: SourceAnnotation {
107
+ SourceAnnotation {
109
108
range: ( 6 , 8 ) ,
110
109
label: "Sushi2" ,
111
- annotation_type: snippet :: AnnotationType :: Note ,
110
+ annotation_type: AnnotationType :: Note ,
112
111
} ,
113
112
] ,
114
113
fold: false ,
@@ -132,14 +131,14 @@ fn test_point_to_double_width_characters_multiple() {
132
131
#[ test]
133
132
fn test_point_to_double_width_characters_mixed ( ) {
134
133
let snippets = Snippet {
135
- slices : vec ! [ snippet :: Slice {
134
+ slices : vec ! [ Slice {
136
135
source: "こんにちは、新しいWorld!" ,
137
136
line_start: 1 ,
138
137
origin: Some ( "<current file>" ) ,
139
- annotations: vec![ snippet :: SourceAnnotation {
138
+ annotations: vec![ SourceAnnotation {
140
139
range: ( 6 , 14 ) ,
141
140
label: "New world" ,
142
- annotation_type: snippet :: AnnotationType :: Error ,
141
+ annotation_type: AnnotationType :: Error ,
143
142
} ] ,
144
143
fold: false ,
145
144
} ] ,
0 commit comments