Skip to content

Commit a3d902d

Browse files
author
Dart CI
committed
Version 2.11.0-242.0.dev
Merge commit '0b14abc2a5f57e3fab2b0d031bf18572670a9a0d' into 'dev'
2 parents 874709e + 0b14abc commit a3d902d

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

pkg/dartdev/test/commands/fix_test.dart

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,53 @@ void main() {
1111
}
1212

1313
void defineFix() {
14-
// todo (pq): add tests when the `fix` command is enabled.
14+
TestProject p;
15+
16+
setUp(() => p = null);
17+
18+
tearDown(() => p?.dispose());
19+
20+
test('none', () {
21+
p = project(mainSrc: 'int get foo => 1;\n');
22+
var result = p.runSync('fix', [p.dirPath]);
23+
expect(result.exitCode, 0);
24+
expect(result.stderr, isEmpty);
25+
expect(result.stdout, contains('Nothing to fix!'));
26+
});
27+
28+
test('no args', () {
29+
p = project(
30+
mainSrc: '''
31+
var x = "";
32+
''',
33+
analysisOptions: '''
34+
linter:
35+
rules:
36+
- prefer_single_quotes
37+
''',
38+
);
39+
var result = p.runSync('fix', [], workingDir: p.dirPath);
40+
expect(result.exitCode, 0);
41+
expect(result.stderr, isEmpty);
42+
expect(result.stdout, contains('Fixed 1 files.'));
43+
});
44+
45+
test('.', () {
46+
p = project(
47+
mainSrc: '''
48+
var x = "";
49+
''',
50+
analysisOptions: '''
51+
linter:
52+
rules:
53+
- prefer_single_quotes
54+
''',
55+
);
56+
var result = p.runSync('fix', ['.'], workingDir: p.dirPath);
57+
expect(result.exitCode, 0);
58+
expect(result.stderr, isEmpty);
59+
expect(result.stdout, contains('Fixed 1 files.'));
60+
});
61+
62+
// todo (pq): add tests for analyzer excludes, ignores, etc.
1563
}

tools/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ CHANNEL dev
2727
MAJOR 2
2828
MINOR 11
2929
PATCH 0
30-
PRERELEASE 241
30+
PRERELEASE 242
3131
PRERELEASE_PATCH 0

0 commit comments

Comments
 (0)