Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Test instance type
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Garcia committed Apr 28, 2021
1 parent 7a76dbf commit e8c5092
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/path_provider/path_provider/lib/path_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ class MissingPlatformDirectoryException implements Exception {
}
}

void main() {

}


/// Path to the temporary directory on the device that is not backed up and is
/// suitable for storing caches of downloaded files.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'dart:async';

import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:shared_preferences_linux/shared_preferences_linux.dart';
import 'package:shared_preferences_platform_interface/shared_preferences_platform_interface.dart';

void main() {
Expand All @@ -34,14 +35,16 @@ void main() {

setUp(() {
preferences = SharedPreferencesStorePlatform.instance;
expect(
preferences.runtimeType.toString(), equals('SharedPreferencesLinux'));
});

tearDown(() async {
await preferences.clear();
});

test('instance is Linux implementation', () {
expect(preferences, isA<PathProviderLinux>());
});

testWidgets('reading', (WidgetTester _) async {
final all = await preferences.getAll();
expect(all['String'], isNull);
Expand Down

0 comments on commit e8c5092

Please sign in to comment.