11@Skip (
2- 'To run these tests, make sure an emulator or a real device is connected, then \' cd example\' and : \' flutter run test/pfd_text_test .dart\' ' )
2+ 'To run these tests, make sure an emulator or a real device is connected, then \' cd example\' and : \' flutter run test/pdf_text_test .dart\' ' )
33import 'dart:io' ;
44
55import 'package:flutter/foundation.dart' ;
@@ -21,13 +21,13 @@ void main() async {
2121
2222 final testDirectoryPath =
2323 join ((await getTemporaryDirectory ()).path, "temp_pdf_text_dir" );
24- final PdfTestUtils pdfUtils = PdfTestUtils (testDirectoryPath);
25- final File encryptedPdf = File (join (testDirectoryPath, "encrypted.pdf" ));
24+ final PdfTestUtils pdfUtils = PdfTestUtils (testDirectoryPath);
25+ final File encryptedPdf = File (join (testDirectoryPath, "encrypted.pdf" ));
2626
2727 setUpAll (() async {
2828 /// init mock http client so that the PDFDoc.fromUrl() obtains the mocked version
2929 ClientProvider (
30- client: MockClient ((Request req) => Future .value (Response .bytes (
30+ client: MockClient ((Request req) => Future .value (Response .bytes (
3131 File (join (testDirectoryPath, req.url.path.split ("/" ).last))
3232 .readAsBytesSync (),
3333 200 ))));
@@ -56,7 +56,7 @@ void main() async {
5656 subject: "The most profound theological book ever written" ,
5757 keywords: "Doctor,Angelicus" );
5858
59- List <String > page = [
59+ List <String > page = [
6060 "Et ut intentio nostra sub aliquibus certis limitibus comprehendatur," ,
6161 "necessarium est primo investigare de ipsa sacra doctrina, qualis sit, et ad quæ se extendat." ,
6262 "Circa quæ quærenda sunt decem." ,
@@ -65,11 +65,11 @@ void main() async {
6565 "Tertio, utrum sit una vel plures."
6666 ];
6767
68- File pdf = await pdfUtils.createPdfFile ([page], info: info);
68+ File pdf = await pdfUtils.createPdfFile ([page], info: info);
6969
70- PDFDoc fromFile = await PDFDoc .fromFile (pdf);
71- PDFDoc fromPath = await PDFDoc .fromPath (pdf.path);
72- PDFDoc fromUrl =
70+ PDFDoc fromFile = await PDFDoc .fromFile (pdf);
71+ PDFDoc fromPath = await PDFDoc .fromPath (pdf.path);
72+ PDFDoc fromUrl =
7373 await PDFDoc .fromURL ("http://localhost/${basename (pdf .path )}" );
7474
7575 await forEach ([fromFile, fromPath, fromUrl], (dynamic doc) async {
@@ -91,24 +91,24 @@ void main() async {
9191 subject: "Detecitve stories" ,
9292 keywords: "Holmes,Watson" );
9393
94- List <String > page1 = [
94+ List <String > page1 = [
9595 "To Sherlock Holmes she is always the woman." ,
9696 "I have seldom heard him mention her under any other name." ,
9797 "In his eyes she eclipses and predominates the whole of her sex." ,
9898 ];
9999
100- List <String > page2 = [
100+ List <String > page2 = [
101101 "himself in a false position. He never spoke of the softer" ,
102102 "They were admirable things for the observer-excellent for" ,
103103 "But for the trained reasoner to admit such intrusions into" ,
104104 "was to introduce a distracting factor which might throw a" ,
105105 ];
106106
107- File pdf = await pdfUtils.createPdfFile ([page1, page2], info: info);
107+ File pdf = await pdfUtils.createPdfFile ([page1, page2], info: info);
108108
109- PDFDoc fromFile = await PDFDoc .fromFile (pdf);
110- PDFDoc fromPath = await PDFDoc .fromPath (pdf.path);
111- PDFDoc fromUrl =
109+ PDFDoc fromFile = await PDFDoc .fromFile (pdf);
110+ PDFDoc fromPath = await PDFDoc .fromPath (pdf.path);
111+ PDFDoc fromUrl =
112112 await PDFDoc .fromURL ("http://localhost/${basename (pdf .path )}" );
113113
114114 await forEach ([fromFile, fromPath, fromUrl], (dynamic doc) async {
@@ -126,11 +126,11 @@ void main() async {
126126 test ("should read text from a password protected pdf file" , () async {
127127 expect (encryptedPdf.existsSync (), true );
128128
129- PDFDoc fromFile =
129+ PDFDoc fromFile =
130130 await PDFDoc .fromFile (encryptedPdf, password: "password" );
131- PDFDoc fromPath =
131+ PDFDoc fromPath =
132132 await PDFDoc .fromPath (encryptedPdf.path, password: "password" );
133- PDFDoc fromUrl = await PDFDoc .fromURL (
133+ PDFDoc fromUrl = await PDFDoc .fromURL (
134134 "http://localhost/${basename (encryptedPdf .path )}" ,
135135 password: "password" );
136136
@@ -145,7 +145,7 @@ void main() async {
145145 test ("should fail if the password is invalid" , () async {
146146 expect (encryptedPdf.existsSync (), true );
147147
148- int exceptionCount = 0 ;
148+ int exceptionCount = 0 ;
149149
150150 final fromFile =
151151 () => PDFDoc .fromFile (encryptedPdf, password: "invalid-password" );
@@ -158,7 +158,7 @@ void main() async {
158158 await forEach ([fromFile, fromPath, fromURL], (dynamic foo) async {
159159 try {
160160 await foo ();
161- } on PlatformException catch (e) {
161+ } on PlatformException catch (e) {
162162 expect (
163163 e.message,
164164 contains (isIos
@@ -174,4 +174,4 @@ void main() async {
174174 reason: "All attempts with invalid password must fail!" );
175175 });
176176 });
177- }
177+ }
0 commit comments