File tree Expand file tree Collapse file tree 4 files changed +14
-16
lines changed
image_picker/image_picker_platform_interface Expand file tree Collapse file tree 4 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -11,17 +11,8 @@ import 'dart:typed_data';
1111import 'package:flutter_test/flutter_test.dart' ;
1212import 'package:cross_file/cross_file.dart' ;
1313
14- // Please note that executing this test with command
15- // `flutter test test/x_file_io_test.dart` will set the directory
16- // to ./file_selector_platform_interface.
17- //
18- // This will cause our hello.txt file to be not be found. Please
19- // execute this test with `flutter test` or change the path prefix
20- // to ./test/assets/
21- //
22- // https://github.com/flutter/flutter/issues/20907
23-
24- final pathPrefix = './assets/' ;
14+ final pathPrefix =
15+ Directory .current.path.endsWith ('test' ) ? './assets/' : './test/assets/' ;
2516final path = pathPrefix + 'hello.txt' ;
2617final String expectedStringContents = 'Hello, world!' ;
2718final Uint8List bytes = Uint8List .fromList (utf8.encode (expectedStringContents));
@@ -30,7 +21,7 @@ final String textFilePath = textFile.path;
3021
3122void main () {
3223 group ('Create with a path' , () {
33- final file = XFile (textFilePath);
24+ final XFile file = XFile (textFilePath);
3425
3526 test ('Can be read as a string' , () async {
3627 expect (await file.readAsString (), equals (expectedStringContents));
Original file line number Diff line number Diff line change 1+ ## 1.1.6
2+
3+ * Fix test asset file location.
4+
15## 1.1.5
26
37* Update Flutter SDK constraint.
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ description: A common platform interface for the image_picker plugin.
33homepage : https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker_platform_interface
44# NOTE: We strongly prefer non-breaking changes, even at the expense of a
55# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
6- version : 1.1.5
6+ version : 1.1.6
77
88dependencies :
99 flutter :
Original file line number Diff line number Diff line change @@ -11,14 +11,17 @@ import 'dart:typed_data';
1111import 'package:flutter_test/flutter_test.dart' ;
1212import 'package:image_picker_platform_interface/image_picker_platform_interface.dart' ;
1313
14+ final pathPrefix =
15+ Directory .current.path.endsWith ('test' ) ? './assets/' : './test/assets/' ;
16+ final path = pathPrefix + 'hello.txt' ;
1417final String expectedStringContents = 'Hello, world!' ;
15- final Uint8List bytes = utf8.encode (expectedStringContents);
16- final File textFile = File ('./assets/hello.txt' );
18+ final Uint8List bytes = Uint8List . fromList ( utf8.encode (expectedStringContents) );
19+ final File textFile = File (path );
1720final String textFilePath = textFile.path;
1821
1922void main () {
2023 group ('Create with an objectUrl' , () {
21- final pickedFile = PickedFile (textFilePath);
24+ final PickedFile pickedFile = PickedFile (textFilePath);
2225
2326 test ('Can be read as a string' , () async {
2427 expect (await pickedFile.readAsString (), equals (expectedStringContents));
You can’t perform that action at this time.
0 commit comments