Skip to content

Commit cea5a1a

Browse files
authored
Add tests for digit separators. (#1633)
Add tests for digit separators. (They're already working, but there were no tests.)
1 parent d76b6ee commit cea5a1a

File tree

6 files changed

+82
-6
lines changed

6 files changed

+82
-6
lines changed

.github/workflows/test-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
sdk: [3.4.0, dev]
23+
sdk: [3.6.0, dev]
2424
steps:
2525
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
2626
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
@@ -50,7 +50,7 @@ jobs:
5050
matrix:
5151
# Add macos-latest and/or windows-latest if relevant for this package.
5252
os: [ubuntu-latest]
53-
sdk: [3.4.0, dev]
53+
sdk: [3.6.0, dev]
5454
steps:
5555
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
5656
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.0.2-wip
2+
3+
* Add tests for digit separators.
4+
15
## 3.0.1
26

37
* Handle trailing commas in for-loop updaters (#1354).

lib/src/cli/formatter_options.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import 'show.dart';
1212
import 'summary.dart';
1313

1414
// Note: The following line of code is modified by tool/grind.dart.
15-
const dartStyleVersion = '3.0.1';
15+
const dartStyleVersion = '3.0.2-wip';
1616

1717
/// Global options that affect how the formatter produces and uses its outputs.
1818
final class FormatterOptions {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: dart_style
22
# Note: See tool/grind.dart for how to bump the version.
3-
version: 3.0.1
3+
version: 3.0.2-wip
44
description: >-
55
Opinionated, automatic Dart source code formatter.
66
Provides an API and a CLI tool.

test/short/whitespace/expressions.stmt

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,40 @@ var record = const (1, 2);
224224
[a!, Foo(:b), ...] = o;
225225
{'k': _, ...} = o;
226226
Foo(prop: value, :inferred) = o;
227-
}
227+
}
228+
>>> digit separators
229+
[
230+
100__000_000__000_000__000_000,
231+
0x4000_0000_0000_0000,
232+
0.000_000_000_01,
233+
0x00_14_22_01_23_45,
234+
555_123_4567,
235+
00_1_00,
236+
-00_99,
237+
0__0__0__0__0,
238+
3.141_592_653,
239+
1__9.7_3_9,
240+
-1.6_1_8,
241+
0__0,
242+
1e3_0,
243+
1_2e3,
244+
1_2.3_4e1,
245+
];
246+
<<<
247+
[
248+
100__000_000__000_000__000_000,
249+
0x4000_0000_0000_0000,
250+
0.000_000_000_01,
251+
0x00_14_22_01_23_45,
252+
555_123_4567,
253+
00_1_00,
254+
-00_99,
255+
0__0__0__0__0,
256+
3.141_592_653,
257+
1__9.7_3_9,
258+
-1.6_1_8,
259+
0__0,
260+
1e3_0,
261+
1_2e3,
262+
1_2.3_4e1,
263+
];

test/tall/expression/other.stmt

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,40 @@ throw new FormatException('This is a long exception message.');
7171
<<<
7272
throw new FormatException(
7373
'This is a long exception message.',
74-
);
74+
);
75+
>>> Digit separators.
76+
[
77+
100__000_000__000_000__000_000,
78+
0x4000_0000_0000_0000,
79+
0.000_000_000_01,
80+
0x00_14_22_01_23_45,
81+
555_123_4567,
82+
00_1_00,
83+
-00_99,
84+
0__0__0__0__0,
85+
3.141_592_653,
86+
1__9.7_3_9,
87+
-1.6_1_8,
88+
0__0,
89+
1e3_0,
90+
1_2e3,
91+
1_2.3_4e1,
92+
];
93+
<<<
94+
[
95+
100__000_000__000_000__000_000,
96+
0x4000_0000_0000_0000,
97+
0.000_000_000_01,
98+
0x00_14_22_01_23_45,
99+
555_123_4567,
100+
00_1_00,
101+
-00_99,
102+
0__0__0__0__0,
103+
3.141_592_653,
104+
1__9.7_3_9,
105+
-1.6_1_8,
106+
0__0,
107+
1e3_0,
108+
1_2e3,
109+
1_2.3_4e1,
110+
];

0 commit comments

Comments
 (0)