@@ -15,18 +15,22 @@ fn test_format_title() {
15
15
slices : vec ! [ ] ,
16
16
} ;
17
17
let output = dl:: DisplayList {
18
- body : vec ! [ dl:: DisplayLine :: Raw ( dl:: DisplayRawLine :: Annotation {
19
- annotation: dl:: Annotation {
20
- annotation_type: dl:: DisplayAnnotationType :: Error ,
21
- id: Some ( "E0001" . to_string( ) ) ,
22
- label: vec![ dl:: DisplayTextFragment {
23
- content: "This is a title" . to_string( ) ,
24
- style: dl:: DisplayTextStyle :: Emphasis ,
25
- } ] ,
26
- } ,
27
- source_aligned: false ,
28
- continuation: false ,
29
- } ) ] ,
18
+ body : vec ! [
19
+ dl:: DisplayLine :: Raw ( dl:: DisplayRawLine :: Annotation {
20
+ annotation: dl:: Annotation {
21
+ annotation_type: dl:: DisplayAnnotationType :: Error ,
22
+ id: Some ( "E0001" . to_string( ) ) ,
23
+ label: vec![
24
+ dl:: DisplayTextFragment {
25
+ content: "This is a title" . to_string( ) ,
26
+ style: dl:: DisplayTextStyle :: Emphasis ,
27
+ } ,
28
+ ] ,
29
+ } ,
30
+ source_aligned: false ,
31
+ continuation: false ,
32
+ } ) ,
33
+ ] ,
30
34
} ;
31
35
assert_eq ! ( dl:: DisplayList :: from( input) , output) ;
32
36
}
@@ -36,13 +40,15 @@ fn test_format_slice() {
36
40
let input = snippet:: Snippet {
37
41
title : None ,
38
42
footer : vec ! [ ] ,
39
- slices : vec ! [ snippet:: Slice {
40
- source: "This is line 1\n This is line 2" . to_string( ) ,
41
- line_start: 5402 ,
42
- origin: None ,
43
- annotations: vec![ ] ,
44
- fold: false ,
45
- } ] ,
43
+ slices : vec ! [
44
+ snippet:: Slice {
45
+ source: "This is line 1\n This is line 2" . to_string( ) ,
46
+ line_start: 5402 ,
47
+ origin: None ,
48
+ annotations: vec![ ] ,
49
+ fold: false ,
50
+ } ,
51
+ ] ,
46
52
} ;
47
53
let output = dl:: DisplayList {
48
54
body : vec ! [
@@ -82,17 +88,21 @@ fn test_format_slice_annotation_standalone() {
82
88
let input = snippet:: Snippet {
83
89
title : None ,
84
90
footer : vec ! [ ] ,
85
- slices : vec ! [ snippet:: Slice {
86
- source: "This is line 1\n This is line 2" . to_string( ) ,
87
- line_start: 5402 ,
88
- origin: None ,
89
- annotations: vec![ snippet:: SourceAnnotation {
90
- range: ( 22 , 24 ) ,
91
- label: "Test annotation" . to_string( ) ,
92
- annotation_type: snippet:: AnnotationType :: Info ,
93
- } ] ,
94
- fold: false ,
95
- } ] ,
91
+ slices : vec ! [
92
+ snippet:: Slice {
93
+ source: "This is line 1\n This is line 2" . to_string( ) ,
94
+ line_start: 5402 ,
95
+ origin: None ,
96
+ annotations: vec![
97
+ snippet:: SourceAnnotation {
98
+ range: ( 22 , 24 ) ,
99
+ label: "Test annotation" . to_string( ) ,
100
+ annotation_type: snippet:: AnnotationType :: Info ,
101
+ } ,
102
+ ] ,
103
+ fold: false ,
104
+ } ,
105
+ ] ,
96
106
} ;
97
107
let output = dl:: DisplayList {
98
108
body : vec ! [
@@ -124,10 +134,12 @@ fn test_format_slice_annotation_standalone() {
124
134
annotation: dl:: Annotation {
125
135
annotation_type: dl:: DisplayAnnotationType :: Info ,
126
136
id: None ,
127
- label: vec![ dl:: DisplayTextFragment {
128
- content: "Test annotation" . to_string( ) ,
129
- style: dl:: DisplayTextStyle :: Regular ,
130
- } ] ,
137
+ label: vec![
138
+ dl:: DisplayTextFragment {
139
+ content: "Test annotation" . to_string( ) ,
140
+ style: dl:: DisplayTextStyle :: Regular ,
141
+ } ,
142
+ ] ,
131
143
} ,
132
144
range: ( 6 , 8 ) ,
133
145
annotation_type: dl:: DisplayAnnotationType :: Info ,
0 commit comments