Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: testing/resources/javascript/util_printx.in

Issue 1837543002: Added test for util.printx() and make it match spec. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Need wchar in one more place. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/javascript/util.cpp ('k') | testing/resources/javascript/util_printx_expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 {{header}}
2 {{object 1 0}} <<
3 /Type /Catalog
4 /Pages 2 0 R
5 /OpenAction 10 0 R
6 >>
7 endobj
8 {{object 2 0}} <<
9 /Type /Pages
10 /Count 1
11 /Kids [
12 3 0 R
13 ]
14 >>
15 endobj
16 % Page number 0.
17 {{object 3 0}} <<
18 /Type /Page
19 /Parent 2 0 R
20 /Resources <<
21 /Font <</F1 15 0 R>>
22 >>
23 /Contents [21 0 R]
24 /MediaBox [0 0 612 792]
25 >>
26 % OpenAction action
27 {{object 10 0}} <<
28 /Type /Action
29 /S /JavaScript
30 /JS 11 0 R
31 >>
32 endobj
33 % JS program to exexute
34 {{object 11 0}} <<
35 >>
36 stream
37 function TestOneFormat(fmt, src) {
38 var title = "('" + fmt + "', '" + src + "')";
39 try {
40 app.alert(title + " => '" + util.printx(fmt, src) + "'");
41 }
42 catch (e) {
43 app.alert(title + ": Caught error: " + e);
44 }
45 }
46 TestOneFormat("", "");
47 TestOneFormat("", "123");
48 TestOneFormat("??", "");
49 TestOneFormat("??", "f2");
50 TestOneFormat("??", "f27");
51 TestOneFormat("XXX", "");
52 TestOneFormat("XXX", "1afp3.");
53 TestOneFormat("XXX", "-1Afp3.d33F$");
54 TestOneFormat("AAA", "");
55 TestOneFormat("AAA", "-1Afp3.");
56 TestOneFormat("AAA", "-1Afp3.d33F$");
57 TestOneFormat("999", "");
58 TestOneFormat("999", "-1Afp3.");
59 TestOneFormat("999", "-1Afp3.d33F$");
60 TestOneFormat("9*9", "");
61 TestOneFormat("9*9", "-1Afp3.");
62 TestOneFormat("[*]X", "-1Afp3.");
63 TestOneFormat("<*", "-1Afp3.d33F$");
64 TestOneFormat(">*", "-1Afp3.d33F$");
65 TestOneFormat("<[AAAAAAAAAAA]", "-1Afp3.d33F$");
66 TestOneFormat(">[AAAAAAAAAAA]", "-1Afp3.d33F$");
67 TestOneFormat("<[XXXXXXXXXXX]", "-1Afp3.d33F$");
68 TestOneFormat(">[XXXXXXXXXXX]", "-1Afp3.d33F$");
69 TestOneFormat("<[XXXXXXXXXXX]", "-1Afp3.d33F$");
70 TestOneFormat(">[???????????]", "-1Afp3.d33F$");
71 TestOneFormat("<[???????????]", "-1Afp3.d33F$");
72 TestOneFormat("\\>[\\**]", "-1Afp3.d33F$");
73 TestOneFormat("\\>[\\\\**]", "-1Afp3.d33F$");
74 TestOneFormat("=*", "-1Afp3.d33F$");
75 TestOneFormat("<??????=*", "-1Afp3.d33F$");
76 TestOneFormat(">??????=*", "-1Afp3.d33F$");
77 TestOneFormat(">??????<*", "-1Afp3.d33F$");
78 TestOneFormat("clams", "-1Afp3.d33F$");
79 TestOneFormat("cl9ms", "-1Afp3.d33F$");
80 TestOneFormat("cl\\9ms", "-1Afp3.d33F$");
81 endstream
82 endobj
83 {{xref}}
84 trailer <<
85 /Root 1 0 R
86 >>
87 {{startxref}}
88 %%EOF
OLDNEW
« no previous file with comments | « fpdfsdk/javascript/util.cpp ('k') | testing/resources/javascript/util_printx_expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698