Merge commit '04bb1f2f035343217875ce0fc19d3a7abde41717' into HEAD
Bug: 155031873
Change-Id: Ie7dc3f5c4b8999adf8e8885761fe65fd6ee65227
Merged-In: Ie7dc3f5c4b8999adf8e8885761fe65fd6ee65227
diff --git a/testing/resources/javascript/util_scand.in b/testing/resources/javascript/util_scand.in
new file mode 100644
index 0000000..25462d0
--- /dev/null
+++ b/testing/resources/javascript/util_scand.in
@@ -0,0 +1,57 @@
+{{header}}
+{{object 1 0}} <<
+ /Type /Catalog
+ /Pages 2 0 R
+ /OpenAction 10 0 R
+>>
+endobj
+{{object 2 0}} <<
+ /Type /Pages
+ /Count 1
+ /Kids [
+ 3 0 R
+ ]
+>>
+endobj
+% Page number 0.
+{{object 3 0}} <<
+ /Type /Page
+ /Parent 2 0 R
+ /MediaBox [0 0 612 792]
+>>
+endobj
+% OpenAction action
+{{object 10 0}} <<
+ /Type /Action
+ /S /JavaScript
+ /JS 11 0 R
+>>
+endobj
+% JS program to exexute
+{{object 11 0}} <<
+ {{streamlen}}
+>>
+stream
+{{include expect.js}}
+
+try {
+ const tuesday = "Tue, 20 Dec 2016 21:48:50 GMT";
+ const friday = "Fri, 09 May 2014 11:22:03 GMT";
+ expectError("util.scand()");
+ expectError("util.scand('12/20/2016')");
+ expect("util.scand('mm/dd/yyyy', '12/20/2016').toUTCString()", tuesday);
+ expect("util.scand('dd/mm/yyyy', '20/12/2016').toUTCString()", tuesday);
+ expect("util.scand('yyyy/mm/dd', '2016/12/20').toUTCString()", tuesday);
+ expect("util.scand('dd/mmm/yyyy', '20/Dec/2016').toUTCString()", tuesday);
+ expect("util.scand('..dd:-:mmm/yyyy', '**20/*/Dec.2016').toUTCString()", tuesday);
+ expect("util.scand('hh:MM:ss', '11:22:03').toUTCString()", friday);
+ expect("util.scand('s:MM:hh', '3:22:11').toUTCString()", friday);
+} catch (e) {
+ app.alert("Truly unexpected error: " + e);
+}
+endstream
+endobj
+{{xref}}
+{{trailer}}
+{{startxref}}
+%%EOF