Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Review feedback + update per new lints
Browse files Browse the repository at this point in the history
  • Loading branch information
mit-mit committed Jun 10, 2024
1 parent 10d501f commit 517db66
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:lints/recommended.yaml
include: package:dart_flutter_team_lints/analysis_options.yaml

analyzer:
errors:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 1.0.0
publish_to: none

environment:
sdk: ^3.0.0
sdk: ^3.2.0

dependencies:
platform:
Expand Down
6 changes: 3 additions & 3 deletions lib/src/testing/fake_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ class FakePlatform extends Platform {
/// [json] must be a JSON string that matches the encoding produced by
/// [toJson].
factory FakePlatform.fromJson(String json) {
final Map<String, dynamic> map =
const JsonDecoder().convert(json) as Map<String, dynamic>;
final map = const JsonDecoder().convert(json) as Map<String, dynamic>;
return FakePlatform(
numberOfProcessors: map['numberOfProcessors'] as int?,
pathSeparator: map['pathSeparator'] as String?,
Expand All @@ -92,7 +91,8 @@ class FakePlatform extends Platform {
);
}

/// Creates a new [FakePlatform] from this one, with some properties replaced by the given properties.
/// Creates a new [FakePlatform] from this one, with some properties replaced
/// by the given properties.
FakePlatform copyWith({
int? numberOfProcessors,
String? pathSeparator,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
sdk: ^3.2.0

dev_dependencies:
lints: ^4.0.0
dart_flutter_team_lints: ^3.1.0
test: ^1.16.8

topics:
Expand Down
10 changes: 5 additions & 5 deletions test/fake_platform_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void main() {
});

test('convertsPropertiesToMutable', () {
final String key = fake.environment.keys.first;
final key = fake.environment.keys.first;

expect(fake.environment[key], local.environment[key]);
fake.environment[key] = 'FAKE';
Expand All @@ -62,7 +62,7 @@ void main() {
});

test('overrides a value, but leaves others intact', () {
final FakePlatform copy = fake.copyWith(
final copy = fake.copyWith(
numberOfProcessors: -1,
);
expect(copy.numberOfProcessors, equals(-1));
Expand Down Expand Up @@ -96,7 +96,7 @@ void main() {
stdoutSupportsAnsi: true,
localeName: 'local',
);
final FakePlatform copy = fake.copyWith(
final copy = fake.copyWith(
numberOfProcessors: local.numberOfProcessors,
pathSeparator: local.pathSeparator,
operatingSystem: local.operatingSystem,
Expand All @@ -119,7 +119,7 @@ void main() {

group('json', () {
test('fromJson', () {
final String json = io.File('test/platform.json').readAsStringSync();
final json = io.File('test/platform.json').readAsStringSync();
fake = FakePlatform.fromJson(json);
expect(fake.numberOfProcessors, 8);
expect(fake.pathSeparator, '/');
Expand Down Expand Up @@ -147,7 +147,7 @@ void main() {
});

test('Throws when unset non-null values are read', () {
final FakePlatform platform = FakePlatform();
final platform = FakePlatform();

expect(() => platform.numberOfProcessors, throwsA(isStateError));
expect(() => platform.pathSeparator, throwsA(isStateError));
Expand Down

0 comments on commit 517db66

Please sign in to comment.