diff options
Diffstat (limited to 'editors/code/src/test')
5 files changed, 62 insertions, 62 deletions
diff --git a/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts b/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts index 6c7f436f3..96ec8c614 100644 --- a/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts +++ b/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts | |||
@@ -6,12 +6,12 @@ import SuggestedFix from '../../../utils/diagnostics/SuggestedFix'; | |||
6 | 6 | ||
7 | const location1 = new vscode.Location( | 7 | const location1 = new vscode.Location( |
8 | vscode.Uri.file('/file/1'), | 8 | vscode.Uri.file('/file/1'), |
9 | new vscode.Range(new vscode.Position(1, 2), new vscode.Position(3, 4)) | 9 | new vscode.Range(new vscode.Position(1, 2), new vscode.Position(3, 4)), |
10 | ); | 10 | ); |
11 | 11 | ||
12 | const location2 = new vscode.Location( | 12 | const location2 = new vscode.Location( |
13 | vscode.Uri.file('/file/2'), | 13 | vscode.Uri.file('/file/2'), |
14 | new vscode.Range(new vscode.Position(5, 6), new vscode.Position(7, 8)) | 14 | new vscode.Range(new vscode.Position(5, 6), new vscode.Position(7, 8)), |
15 | ); | 15 | ); |
16 | 16 | ||
17 | describe('SuggestedFix', () => { | 17 | describe('SuggestedFix', () => { |
@@ -20,13 +20,13 @@ describe('SuggestedFix', () => { | |||
20 | const suggestion1 = new SuggestedFix( | 20 | const suggestion1 = new SuggestedFix( |
21 | 'Replace me!', | 21 | 'Replace me!', |
22 | location1, | 22 | location1, |
23 | 'With this!' | 23 | 'With this!', |
24 | ); | 24 | ); |
25 | 25 | ||
26 | const suggestion2 = new SuggestedFix( | 26 | const suggestion2 = new SuggestedFix( |
27 | 'Replace me!', | 27 | 'Replace me!', |
28 | location1, | 28 | location1, |
29 | 'With this!' | 29 | 'With this!', |
30 | ); | 30 | ); |
31 | 31 | ||
32 | assert(suggestion1.isEqual(suggestion2)); | 32 | assert(suggestion1.isEqual(suggestion2)); |
@@ -36,13 +36,13 @@ describe('SuggestedFix', () => { | |||
36 | const suggestion1 = new SuggestedFix( | 36 | const suggestion1 = new SuggestedFix( |
37 | 'Replace me!', | 37 | 'Replace me!', |
38 | location1, | 38 | location1, |
39 | 'With this!' | 39 | 'With this!', |
40 | ); | 40 | ); |
41 | 41 | ||
42 | const suggestion2 = new SuggestedFix( | 42 | const suggestion2 = new SuggestedFix( |
43 | 'Not the same title!', | 43 | 'Not the same title!', |
44 | location1, | 44 | location1, |
45 | 'With this!' | 45 | 'With this!', |
46 | ); | 46 | ); |
47 | 47 | ||
48 | assert(!suggestion1.isEqual(suggestion2)); | 48 | assert(!suggestion1.isEqual(suggestion2)); |
@@ -52,13 +52,13 @@ describe('SuggestedFix', () => { | |||
52 | const suggestion1 = new SuggestedFix( | 52 | const suggestion1 = new SuggestedFix( |
53 | 'Replace me!', | 53 | 'Replace me!', |
54 | location1, | 54 | location1, |
55 | 'With this!' | 55 | 'With this!', |
56 | ); | 56 | ); |
57 | 57 | ||
58 | const suggestion2 = new SuggestedFix( | 58 | const suggestion2 = new SuggestedFix( |
59 | 'Replace me!', | 59 | 'Replace me!', |
60 | location1, | 60 | location1, |
61 | 'With something else!' | 61 | 'With something else!', |
62 | ); | 62 | ); |
63 | 63 | ||
64 | assert(!suggestion1.isEqual(suggestion2)); | 64 | assert(!suggestion1.isEqual(suggestion2)); |
@@ -68,13 +68,13 @@ describe('SuggestedFix', () => { | |||
68 | const suggestion1 = new SuggestedFix( | 68 | const suggestion1 = new SuggestedFix( |
69 | 'Replace me!', | 69 | 'Replace me!', |
70 | location1, | 70 | location1, |
71 | 'With this!' | 71 | 'With this!', |
72 | ); | 72 | ); |
73 | 73 | ||
74 | const suggestion2 = new SuggestedFix( | 74 | const suggestion2 = new SuggestedFix( |
75 | 'Replace me!', | 75 | 'Replace me!', |
76 | location2, | 76 | location2, |
77 | 'With this!' | 77 | 'With this!', |
78 | ); | 78 | ); |
79 | 79 | ||
80 | assert(!suggestion1.isEqual(suggestion2)); | 80 | assert(!suggestion1.isEqual(suggestion2)); |
@@ -85,14 +85,14 @@ describe('SuggestedFix', () => { | |||
85 | 'Replace me!', | 85 | 'Replace me!', |
86 | location1, | 86 | location1, |
87 | 'With this!', | 87 | 'With this!', |
88 | SuggestionApplicability.MachineApplicable | 88 | SuggestionApplicability.MachineApplicable, |
89 | ); | 89 | ); |
90 | 90 | ||
91 | const suggestion2 = new SuggestedFix( | 91 | const suggestion2 = new SuggestedFix( |
92 | 'Replace me!', | 92 | 'Replace me!', |
93 | location2, | 93 | location2, |
94 | 'With this!', | 94 | 'With this!', |
95 | SuggestionApplicability.HasPlaceholders | 95 | SuggestionApplicability.HasPlaceholders, |
96 | ); | 96 | ); |
97 | 97 | ||
98 | assert(!suggestion1.isEqual(suggestion2)); | 98 | assert(!suggestion1.isEqual(suggestion2)); |
@@ -104,7 +104,7 @@ describe('SuggestedFix', () => { | |||
104 | const suggestion = new SuggestedFix( | 104 | const suggestion = new SuggestedFix( |
105 | 'Replace me!', | 105 | 'Replace me!', |
106 | location1, | 106 | location1, |
107 | 'With this!' | 107 | 'With this!', |
108 | ); | 108 | ); |
109 | 109 | ||
110 | const codeAction = suggestion.toCodeAction(); | 110 | const codeAction = suggestion.toCodeAction(); |
diff --git a/editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts b/editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts index f0328893e..4c1467b57 100644 --- a/editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts +++ b/editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts | |||
@@ -8,20 +8,20 @@ const uri1 = vscode.Uri.file('/file/1'); | |||
8 | const uri2 = vscode.Uri.file('/file/2'); | 8 | const uri2 = vscode.Uri.file('/file/2'); |
9 | 9 | ||
10 | const mockDocument1 = ({ | 10 | const mockDocument1 = ({ |
11 | uri: uri1 | 11 | uri: uri1, |
12 | } as unknown) as vscode.TextDocument; | 12 | } as unknown) as vscode.TextDocument; |
13 | 13 | ||
14 | const mockDocument2 = ({ | 14 | const mockDocument2 = ({ |
15 | uri: uri2 | 15 | uri: uri2, |
16 | } as unknown) as vscode.TextDocument; | 16 | } as unknown) as vscode.TextDocument; |
17 | 17 | ||
18 | const range1 = new vscode.Range( | 18 | const range1 = new vscode.Range( |
19 | new vscode.Position(1, 2), | 19 | new vscode.Position(1, 2), |
20 | new vscode.Position(3, 4) | 20 | new vscode.Position(3, 4), |
21 | ); | 21 | ); |
22 | const range2 = new vscode.Range( | 22 | const range2 = new vscode.Range( |
23 | new vscode.Position(5, 6), | 23 | new vscode.Position(5, 6), |
24 | new vscode.Position(7, 8) | 24 | new vscode.Position(7, 8), |
25 | ); | 25 | ); |
26 | 26 | ||
27 | const diagnostic1 = new vscode.Diagnostic(range1, 'First diagnostic'); | 27 | const diagnostic1 = new vscode.Diagnostic(range1, 'First diagnostic'); |
@@ -32,7 +32,7 @@ function suggestion1(): SuggestedFix { | |||
32 | return new SuggestedFix( | 32 | return new SuggestedFix( |
33 | 'Replace me!', | 33 | 'Replace me!', |
34 | new vscode.Location(uri1, range1), | 34 | new vscode.Location(uri1, range1), |
35 | 'With this!' | 35 | 'With this!', |
36 | ); | 36 | ); |
37 | } | 37 | } |
38 | 38 | ||
@@ -44,7 +44,7 @@ describe('SuggestedFixCollection', () => { | |||
44 | // Specify the document and range that exactly matches | 44 | // Specify the document and range that exactly matches |
45 | const codeActions = suggestedFixes.provideCodeActions( | 45 | const codeActions = suggestedFixes.provideCodeActions( |
46 | mockDocument1, | 46 | mockDocument1, |
47 | range1 | 47 | range1, |
48 | ); | 48 | ); |
49 | 49 | ||
50 | assert.strictEqual(codeActions.length, 1); | 50 | assert.strictEqual(codeActions.length, 1); |
@@ -66,7 +66,7 @@ describe('SuggestedFixCollection', () => { | |||
66 | 66 | ||
67 | const codeActions = suggestedFixes.provideCodeActions( | 67 | const codeActions = suggestedFixes.provideCodeActions( |
68 | mockDocument1, | 68 | mockDocument1, |
69 | range2 | 69 | range2, |
70 | ); | 70 | ); |
71 | 71 | ||
72 | assert(!codeActions || codeActions.length === 0); | 72 | assert(!codeActions || codeActions.length === 0); |
@@ -78,7 +78,7 @@ describe('SuggestedFixCollection', () => { | |||
78 | 78 | ||
79 | const codeActions = suggestedFixes.provideCodeActions( | 79 | const codeActions = suggestedFixes.provideCodeActions( |
80 | mockDocument2, | 80 | mockDocument2, |
81 | range1 | 81 | range1, |
82 | ); | 82 | ); |
83 | 83 | ||
84 | assert(!codeActions || codeActions.length === 0); | 84 | assert(!codeActions || codeActions.length === 0); |
@@ -91,7 +91,7 @@ describe('SuggestedFixCollection', () => { | |||
91 | 91 | ||
92 | const codeActions = suggestedFixes.provideCodeActions( | 92 | const codeActions = suggestedFixes.provideCodeActions( |
93 | mockDocument1, | 93 | mockDocument1, |
94 | range1 | 94 | range1, |
95 | ); | 95 | ); |
96 | 96 | ||
97 | assert(!codeActions || codeActions.length === 0); | 97 | assert(!codeActions || codeActions.length === 0); |
@@ -106,7 +106,7 @@ describe('SuggestedFixCollection', () => { | |||
106 | 106 | ||
107 | const codeActions = suggestedFixes.provideCodeActions( | 107 | const codeActions = suggestedFixes.provideCodeActions( |
108 | mockDocument1, | 108 | mockDocument1, |
109 | range1 | 109 | range1, |
110 | ); | 110 | ); |
111 | 111 | ||
112 | assert.strictEqual(codeActions.length, 1); | 112 | assert.strictEqual(codeActions.length, 1); |
diff --git a/editors/code/src/test/utils/diagnotics/rust.test.ts b/editors/code/src/test/utils/diagnotics/rust.test.ts index 327d15046..cee59061f 100644 --- a/editors/code/src/test/utils/diagnotics/rust.test.ts +++ b/editors/code/src/test/utils/diagnotics/rust.test.ts | |||
@@ -6,14 +6,14 @@ import { | |||
6 | MappedRustDiagnostic, | 6 | MappedRustDiagnostic, |
7 | mapRustDiagnosticToVsCode, | 7 | mapRustDiagnosticToVsCode, |
8 | RustDiagnostic, | 8 | RustDiagnostic, |
9 | SuggestionApplicability | 9 | SuggestionApplicability, |
10 | } from '../../../utils/diagnostics/rust'; | 10 | } from '../../../utils/diagnostics/rust'; |
11 | 11 | ||
12 | function loadDiagnosticFixture(name: string): RustDiagnostic { | 12 | function loadDiagnosticFixture(name: string): RustDiagnostic { |
13 | const jsonText = fs | 13 | const jsonText = fs |
14 | .readFileSync( | 14 | .readFileSync( |
15 | // We're actually in our JavaScript output directory, climb out | 15 | // We're actually in our JavaScript output directory, climb out |
16 | `${__dirname}/../../../../src/test/fixtures/rust-diagnostics/${name}.json` | 16 | `${__dirname}/../../../../src/test/fixtures/rust-diagnostics/${name}.json`, |
17 | ) | 17 | ) |
18 | .toString(); | 18 | .toString(); |
19 | 19 | ||
@@ -33,12 +33,12 @@ function mapFixtureToVsCode(name: string): MappedRustDiagnostic { | |||
33 | describe('mapRustDiagnosticToVsCode', () => { | 33 | describe('mapRustDiagnosticToVsCode', () => { |
34 | it('should map an incompatible type for trait error', () => { | 34 | it('should map an incompatible type for trait error', () => { |
35 | const { diagnostic, suggestedFixes } = mapFixtureToVsCode( | 35 | const { diagnostic, suggestedFixes } = mapFixtureToVsCode( |
36 | 'error/E0053' | 36 | 'error/E0053', |
37 | ); | 37 | ); |
38 | 38 | ||
39 | assert.strictEqual( | 39 | assert.strictEqual( |
40 | diagnostic.severity, | 40 | diagnostic.severity, |
41 | vscode.DiagnosticSeverity.Error | 41 | vscode.DiagnosticSeverity.Error, |
42 | ); | 42 | ); |
43 | assert.strictEqual(diagnostic.source, 'rustc'); | 43 | assert.strictEqual(diagnostic.source, 'rustc'); |
44 | assert.strictEqual( | 44 | assert.strictEqual( |
@@ -46,8 +46,8 @@ describe('mapRustDiagnosticToVsCode', () => { | |||
46 | [ | 46 | [ |
47 | `method \`next\` has an incompatible type for trait`, | 47 | `method \`next\` has an incompatible type for trait`, |
48 | `expected type \`fn(&mut ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&ty::Ref<M>>\``, | 48 | `expected type \`fn(&mut ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&ty::Ref<M>>\``, |
49 | ` found type \`fn(&ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&'list ty::Ref<M>>\`` | 49 | ` found type \`fn(&ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&'list ty::Ref<M>>\``, |
50 | ].join('\n') | 50 | ].join('\n'), |
51 | ); | 51 | ); |
52 | assert.strictEqual(diagnostic.code, 'E0053'); | 52 | assert.strictEqual(diagnostic.code, 'E0053'); |
53 | assert.deepStrictEqual(diagnostic.tags, []); | 53 | assert.deepStrictEqual(diagnostic.tags, []); |
@@ -61,24 +61,24 @@ describe('mapRustDiagnosticToVsCode', () => { | |||
61 | 61 | ||
62 | it('should map an unused variable warning', () => { | 62 | it('should map an unused variable warning', () => { |
63 | const { diagnostic, suggestedFixes } = mapFixtureToVsCode( | 63 | const { diagnostic, suggestedFixes } = mapFixtureToVsCode( |
64 | 'warning/unused_variables' | 64 | 'warning/unused_variables', |
65 | ); | 65 | ); |
66 | 66 | ||
67 | assert.strictEqual( | 67 | assert.strictEqual( |
68 | diagnostic.severity, | 68 | diagnostic.severity, |
69 | vscode.DiagnosticSeverity.Warning | 69 | vscode.DiagnosticSeverity.Warning, |
70 | ); | 70 | ); |
71 | assert.strictEqual( | 71 | assert.strictEqual( |
72 | diagnostic.message, | 72 | diagnostic.message, |
73 | [ | 73 | [ |
74 | 'unused variable: `foo`', | 74 | 'unused variable: `foo`', |
75 | '#[warn(unused_variables)] on by default' | 75 | '#[warn(unused_variables)] on by default', |
76 | ].join('\n') | 76 | ].join('\n'), |
77 | ); | 77 | ); |
78 | assert.strictEqual(diagnostic.code, 'unused_variables'); | 78 | assert.strictEqual(diagnostic.code, 'unused_variables'); |
79 | assert.strictEqual(diagnostic.source, 'rustc'); | 79 | assert.strictEqual(diagnostic.source, 'rustc'); |
80 | assert.deepStrictEqual(diagnostic.tags, [ | 80 | assert.deepStrictEqual(diagnostic.tags, [ |
81 | vscode.DiagnosticTag.Unnecessary | 81 | vscode.DiagnosticTag.Unnecessary, |
82 | ]); | 82 | ]); |
83 | 83 | ||
84 | // No related information | 84 | // No related information |
@@ -89,29 +89,29 @@ describe('mapRustDiagnosticToVsCode', () => { | |||
89 | const [suggestedFix] = suggestedFixes; | 89 | const [suggestedFix] = suggestedFixes; |
90 | assert.strictEqual( | 90 | assert.strictEqual( |
91 | suggestedFix.title, | 91 | suggestedFix.title, |
92 | 'consider prefixing with an underscore: `_foo`' | 92 | 'consider prefixing with an underscore: `_foo`', |
93 | ); | 93 | ); |
94 | assert.strictEqual( | 94 | assert.strictEqual( |
95 | suggestedFix.applicability, | 95 | suggestedFix.applicability, |
96 | SuggestionApplicability.MachineApplicable | 96 | SuggestionApplicability.MachineApplicable, |
97 | ); | 97 | ); |
98 | }); | 98 | }); |
99 | 99 | ||
100 | it('should map a wrong number of parameters error', () => { | 100 | it('should map a wrong number of parameters error', () => { |
101 | const { diagnostic, suggestedFixes } = mapFixtureToVsCode( | 101 | const { diagnostic, suggestedFixes } = mapFixtureToVsCode( |
102 | 'error/E0061' | 102 | 'error/E0061', |
103 | ); | 103 | ); |
104 | 104 | ||
105 | assert.strictEqual( | 105 | assert.strictEqual( |
106 | diagnostic.severity, | 106 | diagnostic.severity, |
107 | vscode.DiagnosticSeverity.Error | 107 | vscode.DiagnosticSeverity.Error, |
108 | ); | 108 | ); |
109 | assert.strictEqual( | 109 | assert.strictEqual( |
110 | diagnostic.message, | 110 | diagnostic.message, |
111 | [ | 111 | [ |
112 | 'this function takes 2 parameters but 3 parameters were supplied', | 112 | 'this function takes 2 parameters but 3 parameters were supplied', |
113 | 'expected 2 parameters' | 113 | 'expected 2 parameters', |
114 | ].join('\n') | 114 | ].join('\n'), |
115 | ); | 115 | ); |
116 | assert.strictEqual(diagnostic.code, 'E0061'); | 116 | assert.strictEqual(diagnostic.code, 'E0061'); |
117 | assert.strictEqual(diagnostic.source, 'rustc'); | 117 | assert.strictEqual(diagnostic.source, 'rustc'); |
@@ -132,12 +132,12 @@ describe('mapRustDiagnosticToVsCode', () => { | |||
132 | 132 | ||
133 | it('should map a Clippy copy pass by ref warning', () => { | 133 | it('should map a Clippy copy pass by ref warning', () => { |
134 | const { diagnostic, suggestedFixes } = mapFixtureToVsCode( | 134 | const { diagnostic, suggestedFixes } = mapFixtureToVsCode( |
135 | 'clippy/trivially_copy_pass_by_ref' | 135 | 'clippy/trivially_copy_pass_by_ref', |
136 | ); | 136 | ); |
137 | 137 | ||
138 | assert.strictEqual( | 138 | assert.strictEqual( |
139 | diagnostic.severity, | 139 | diagnostic.severity, |
140 | vscode.DiagnosticSeverity.Warning | 140 | vscode.DiagnosticSeverity.Warning, |
141 | ); | 141 | ); |
142 | assert.strictEqual(diagnostic.source, 'clippy'); | 142 | assert.strictEqual(diagnostic.source, 'clippy'); |
143 | assert.strictEqual( | 143 | assert.strictEqual( |
@@ -145,8 +145,8 @@ describe('mapRustDiagnosticToVsCode', () => { | |||
145 | [ | 145 | [ |
146 | 'this argument is passed by reference, but would be more efficient if passed by value', | 146 | 'this argument is passed by reference, but would be more efficient if passed by value', |
147 | '#[warn(clippy::trivially_copy_pass_by_ref)] implied by #[warn(clippy::all)]', | 147 | '#[warn(clippy::trivially_copy_pass_by_ref)] implied by #[warn(clippy::all)]', |
148 | 'for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref' | 148 | 'for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref', |
149 | ].join('\n') | 149 | ].join('\n'), |
150 | ); | 150 | ); |
151 | assert.strictEqual(diagnostic.code, 'trivially_copy_pass_by_ref'); | 151 | assert.strictEqual(diagnostic.code, 'trivially_copy_pass_by_ref'); |
152 | assert.deepStrictEqual(diagnostic.tags, []); | 152 | assert.deepStrictEqual(diagnostic.tags, []); |
@@ -165,27 +165,27 @@ describe('mapRustDiagnosticToVsCode', () => { | |||
165 | const [suggestedFix] = suggestedFixes; | 165 | const [suggestedFix] = suggestedFixes; |
166 | assert.strictEqual( | 166 | assert.strictEqual( |
167 | suggestedFix.title, | 167 | suggestedFix.title, |
168 | 'consider passing by value instead: `self`' | 168 | 'consider passing by value instead: `self`', |
169 | ); | 169 | ); |
170 | // Clippy does not mark this with any applicability | 170 | // Clippy does not mark this with any applicability |
171 | assert.strictEqual( | 171 | assert.strictEqual( |
172 | suggestedFix.applicability, | 172 | suggestedFix.applicability, |
173 | SuggestionApplicability.Unspecified | 173 | SuggestionApplicability.Unspecified, |
174 | ); | 174 | ); |
175 | }); | 175 | }); |
176 | 176 | ||
177 | it('should map a mismatched type error', () => { | 177 | it('should map a mismatched type error', () => { |
178 | const { diagnostic, suggestedFixes } = mapFixtureToVsCode( | 178 | const { diagnostic, suggestedFixes } = mapFixtureToVsCode( |
179 | 'error/E0308' | 179 | 'error/E0308', |
180 | ); | 180 | ); |
181 | 181 | ||
182 | assert.strictEqual( | 182 | assert.strictEqual( |
183 | diagnostic.severity, | 183 | diagnostic.severity, |
184 | vscode.DiagnosticSeverity.Error | 184 | vscode.DiagnosticSeverity.Error, |
185 | ); | 185 | ); |
186 | assert.strictEqual( | 186 | assert.strictEqual( |
187 | diagnostic.message, | 187 | diagnostic.message, |
188 | ['mismatched types', 'expected usize, found u32'].join('\n') | 188 | ['mismatched types', 'expected usize, found u32'].join('\n'), |
189 | ); | 189 | ); |
190 | assert.strictEqual(diagnostic.code, 'E0308'); | 190 | assert.strictEqual(diagnostic.code, 'E0308'); |
191 | assert.strictEqual(diagnostic.source, 'rustc'); | 191 | assert.strictEqual(diagnostic.source, 'rustc'); |
diff --git a/editors/code/src/test/utils/diagnotics/vscode.test.ts b/editors/code/src/test/utils/diagnotics/vscode.test.ts index 542dec1f5..4944dd032 100644 --- a/editors/code/src/test/utils/diagnotics/vscode.test.ts +++ b/editors/code/src/test/utils/diagnotics/vscode.test.ts | |||
@@ -5,12 +5,12 @@ import { areDiagnosticsEqual } from '../../../utils/diagnostics/vscode'; | |||
5 | 5 | ||
6 | const range1 = new vscode.Range( | 6 | const range1 = new vscode.Range( |
7 | new vscode.Position(1, 2), | 7 | new vscode.Position(1, 2), |
8 | new vscode.Position(3, 4) | 8 | new vscode.Position(3, 4), |
9 | ); | 9 | ); |
10 | 10 | ||
11 | const range2 = new vscode.Range( | 11 | const range2 = new vscode.Range( |
12 | new vscode.Position(5, 6), | 12 | new vscode.Position(5, 6), |
13 | new vscode.Position(7, 8) | 13 | new vscode.Position(7, 8), |
14 | ); | 14 | ); |
15 | 15 | ||
16 | describe('areDiagnosticsEqual', () => { | 16 | describe('areDiagnosticsEqual', () => { |
@@ -18,13 +18,13 @@ describe('areDiagnosticsEqual', () => { | |||
18 | const diagnostic1 = new vscode.Diagnostic( | 18 | const diagnostic1 = new vscode.Diagnostic( |
19 | range1, | 19 | range1, |
20 | 'Hello, world!', | 20 | 'Hello, world!', |
21 | vscode.DiagnosticSeverity.Error | 21 | vscode.DiagnosticSeverity.Error, |
22 | ); | 22 | ); |
23 | 23 | ||
24 | const diagnostic2 = new vscode.Diagnostic( | 24 | const diagnostic2 = new vscode.Diagnostic( |
25 | range1, | 25 | range1, |
26 | 'Hello, world!', | 26 | 'Hello, world!', |
27 | vscode.DiagnosticSeverity.Error | 27 | vscode.DiagnosticSeverity.Error, |
28 | ); | 28 | ); |
29 | 29 | ||
30 | assert(areDiagnosticsEqual(diagnostic1, diagnostic2)); | 30 | assert(areDiagnosticsEqual(diagnostic1, diagnostic2)); |
@@ -34,14 +34,14 @@ describe('areDiagnosticsEqual', () => { | |||
34 | const diagnostic1 = new vscode.Diagnostic( | 34 | const diagnostic1 = new vscode.Diagnostic( |
35 | range1, | 35 | range1, |
36 | 'Hello, world!', | 36 | 'Hello, world!', |
37 | vscode.DiagnosticSeverity.Error | 37 | vscode.DiagnosticSeverity.Error, |
38 | ); | 38 | ); |
39 | diagnostic1.source = 'rustc'; | 39 | diagnostic1.source = 'rustc'; |
40 | 40 | ||
41 | const diagnostic2 = new vscode.Diagnostic( | 41 | const diagnostic2 = new vscode.Diagnostic( |
42 | range1, | 42 | range1, |
43 | 'Hello, world!', | 43 | 'Hello, world!', |
44 | vscode.DiagnosticSeverity.Error | 44 | vscode.DiagnosticSeverity.Error, |
45 | ); | 45 | ); |
46 | diagnostic2.source = 'clippy'; | 46 | diagnostic2.source = 'clippy'; |
47 | 47 | ||
@@ -52,13 +52,13 @@ describe('areDiagnosticsEqual', () => { | |||
52 | const diagnostic1 = new vscode.Diagnostic( | 52 | const diagnostic1 = new vscode.Diagnostic( |
53 | range1, | 53 | range1, |
54 | 'Hello, world!', | 54 | 'Hello, world!', |
55 | vscode.DiagnosticSeverity.Error | 55 | vscode.DiagnosticSeverity.Error, |
56 | ); | 56 | ); |
57 | 57 | ||
58 | const diagnostic2 = new vscode.Diagnostic( | 58 | const diagnostic2 = new vscode.Diagnostic( |
59 | range2, | 59 | range2, |
60 | 'Hello, world!', | 60 | 'Hello, world!', |
61 | vscode.DiagnosticSeverity.Error | 61 | vscode.DiagnosticSeverity.Error, |
62 | ); | 62 | ); |
63 | 63 | ||
64 | assert(!areDiagnosticsEqual(diagnostic1, diagnostic2)); | 64 | assert(!areDiagnosticsEqual(diagnostic1, diagnostic2)); |
@@ -68,13 +68,13 @@ describe('areDiagnosticsEqual', () => { | |||
68 | const diagnostic1 = new vscode.Diagnostic( | 68 | const diagnostic1 = new vscode.Diagnostic( |
69 | range1, | 69 | range1, |
70 | 'Hello, world!', | 70 | 'Hello, world!', |
71 | vscode.DiagnosticSeverity.Error | 71 | vscode.DiagnosticSeverity.Error, |
72 | ); | 72 | ); |
73 | 73 | ||
74 | const diagnostic2 = new vscode.Diagnostic( | 74 | const diagnostic2 = new vscode.Diagnostic( |
75 | range1, | 75 | range1, |
76 | 'Goodbye!, world!', | 76 | 'Goodbye!, world!', |
77 | vscode.DiagnosticSeverity.Error | 77 | vscode.DiagnosticSeverity.Error, |
78 | ); | 78 | ); |
79 | 79 | ||
80 | assert(!areDiagnosticsEqual(diagnostic1, diagnostic2)); | 80 | assert(!areDiagnosticsEqual(diagnostic1, diagnostic2)); |
@@ -84,13 +84,13 @@ describe('areDiagnosticsEqual', () => { | |||
84 | const diagnostic1 = new vscode.Diagnostic( | 84 | const diagnostic1 = new vscode.Diagnostic( |
85 | range1, | 85 | range1, |
86 | 'Hello, world!', | 86 | 'Hello, world!', |
87 | vscode.DiagnosticSeverity.Warning | 87 | vscode.DiagnosticSeverity.Warning, |
88 | ); | 88 | ); |
89 | 89 | ||
90 | const diagnostic2 = new vscode.Diagnostic( | 90 | const diagnostic2 = new vscode.Diagnostic( |
91 | range1, | 91 | range1, |
92 | 'Hello, world!', | 92 | 'Hello, world!', |
93 | vscode.DiagnosticSeverity.Error | 93 | vscode.DiagnosticSeverity.Error, |
94 | ); | 94 | ); |
95 | 95 | ||
96 | assert(!areDiagnosticsEqual(diagnostic1, diagnostic2)); | 96 | assert(!areDiagnosticsEqual(diagnostic1, diagnostic2)); |
diff --git a/editors/code/src/test/utils/index.ts b/editors/code/src/test/utils/index.ts index 16715a286..9927daaf6 100644 --- a/editors/code/src/test/utils/index.ts +++ b/editors/code/src/test/utils/index.ts | |||
@@ -17,7 +17,7 @@ import * as path from 'path'; | |||
17 | export function run(): Promise<void> { | 17 | export function run(): Promise<void> { |
18 | // Create the mocha test | 18 | // Create the mocha test |
19 | const mocha = new Mocha({ | 19 | const mocha = new Mocha({ |
20 | ui: 'bdd' | 20 | ui: 'bdd', |
21 | }); | 21 | }); |
22 | mocha.useColors(true); | 22 | mocha.useColors(true); |
23 | 23 | ||