-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analysis_server] Only mark positional arguments as editable if they …
…wouldn't require inserting additional values We can _edit_ all existing arguments because we just replace their values. We can also _add_ a new argument for a positional parameter as long as there are no missing positional arguments that would need to come before it (because we can't insert them). Change-Id: Ia66e49f940c463511f472405e90ee46d3b5f6177 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396841 Reviewed-by: Elliott Brooks <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
- Loading branch information
Showing
5 changed files
with
281 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
pkg/analysis_server/test/src/utilities/extensions/numeric_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'package:analysis_server/src/utilities/extensions/numeric.dart'; | ||
import 'package:test/expect.dart'; | ||
import 'package:test_reflective_loader/test_reflective_loader.dart'; | ||
|
||
void main() { | ||
defineReflectiveSuite(() { | ||
defineReflectiveTests(NumericTest); | ||
}); | ||
} | ||
|
||
@reflectiveTest | ||
class NumericTest { | ||
Future<void> test_asStringWithSuffix() async { | ||
var expectedResults = { | ||
1: '1st', | ||
2: '2nd', | ||
3: '3rd', | ||
4: '4th', | ||
5: '5th', | ||
6: '6th', | ||
7: '7th', | ||
8: '8th', | ||
9: '9th', | ||
10: '10th', | ||
11: '11th', | ||
12: '12th', | ||
13: '13th', | ||
14: '14th', | ||
15: '15th', | ||
20: '20th', | ||
21: '21st', | ||
22: '22nd', | ||
23: '23rd', | ||
24: '24th', | ||
88: '88th', | ||
100: '100th', | ||
101: '101st', | ||
111: '111th', | ||
121: '121st', | ||
}; | ||
|
||
for (var MapEntry(:key, :value) in expectedResults.entries) { | ||
expect(key.toStringWithSuffix(), value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters