@@ -15,18 +15,22 @@ fn test_format_title() {
1515 slices : vec ! [ ] ,
1616 } ;
1717 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+ ] ,
3034 } ;
3135 assert_eq ! ( dl:: DisplayList :: from( input) , output) ;
3236}
@@ -36,13 +40,15 @@ fn test_format_slice() {
3640 let input = snippet:: Snippet {
3741 title : None ,
3842 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+ ] ,
4652 } ;
4753 let output = dl:: DisplayList {
4854 body : vec ! [
@@ -82,17 +88,21 @@ fn test_format_slice_annotation_standalone() {
8288 let input = snippet:: Snippet {
8389 title : None ,
8490 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+ ] ,
96106 } ;
97107 let output = dl:: DisplayList {
98108 body : vec ! [
@@ -124,10 +134,12 @@ fn test_format_slice_annotation_standalone() {
124134 annotation: dl:: Annotation {
125135 annotation_type: dl:: DisplayAnnotationType :: Info ,
126136 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+ ] ,
131143 } ,
132144 range: ( 6 , 8 ) ,
133145 annotation_type: dl:: DisplayAnnotationType :: Info ,
0 commit comments