Introspection: add col/row manipulations
[gnumeric.git] / test / t9001-ssconvert-resize.pl
blob5b431955d5dd01ce882799cc0a2b6cb0af54fd08
1 #!/usr/bin/perl -w
2 # -----------------------------------------------------------------------------
4 use strict;
5 use lib ($0 =~ m|^(.*/)| ? $1 : ".");
6 use GnumericTest;
8 &message ("Check ssconvert resize");
10 my $src = "$samples/regress.gnumeric";
11 my $tmp = "regress-resize.gnumeric";
12 &GnumericTest::junkfile ($tmp);
14 # Shrink rows
15 &test_command ("$ssconvert --resize=8192x256 $src $tmp", sub { 1 } );
16 &test_command ("($ssdiff --xml $src $tmp ; true)",
17 sub {
18 $_ eq <<DIFF
19 <?xml version="1.0" encoding="UTF-8"?>
20 <s:Diff xmlns:s="http://www.gnumeric.org/ssdiff.dtd">
21 <s:Sheet Name="Sheet1" Old="0" New="0">
22 <s:Rows Old="65536" New="8192"/>
23 </s:Sheet>
24 </s:Diff>
25 DIFF
26 });
28 # Shrink cols
29 &test_command ("$ssconvert --resize=65536x128 $src $tmp", sub { 1 } );
30 &test_command ("($ssdiff --xml $src $tmp ; true)",
31 sub {
32 $_ eq <<DIFF
33 <?xml version="1.0" encoding="UTF-8"?>
34 <s:Diff xmlns:s="http://www.gnumeric.org/ssdiff.dtd">
35 <s:Sheet Name="Sheet1" Old="0" New="0">
36 <s:Cols Old="256" New="128"/>
37 </s:Sheet>
38 </s:Diff>
39 DIFF
40 });
42 # Shrink both
43 &test_command ("$ssconvert --resize=8192x128 $src $tmp", sub { 1 } );
44 &test_command ("($ssdiff --xml $src $tmp ; true)",
45 sub {
46 $_ eq <<DIFF
47 <?xml version="1.0" encoding="UTF-8"?>
48 <s:Diff xmlns:s="http://www.gnumeric.org/ssdiff.dtd">
49 <s:Sheet Name="Sheet1" Old="0" New="0">
50 <s:Cols Old="256" New="128"/>
51 <s:Rows Old="65536" New="8192"/>
52 </s:Sheet>
53 </s:Diff>
54 DIFF
55 });
57 # Expand rows
58 &test_command ("$ssconvert --resize=1048576x256 $src $tmp", sub { 1 } );
59 &test_command ("($ssdiff --xml $src $tmp ; true)",
60 sub {
61 $_ eq <<DIFF
62 <?xml version="1.0" encoding="UTF-8"?>
63 <s:Diff xmlns:s="http://www.gnumeric.org/ssdiff.dtd">
64 <s:Sheet Name="Sheet1" Old="0" New="0">
65 <s:Rows Old="65536" New="1048576"/>
66 </s:Sheet>
67 </s:Diff>
68 DIFF
69 });
71 # Expand cols
72 &test_command ("$ssconvert --resize=65536x512 $src $tmp", sub { 1 } );
73 &test_command ("($ssdiff --xml $src $tmp ; true)",
74 sub {
75 $_ eq <<DIFF
76 <?xml version="1.0" encoding="UTF-8"?>
77 <s:Diff xmlns:s="http://www.gnumeric.org/ssdiff.dtd">
78 <s:Sheet Name="Sheet1" Old="0" New="0">
79 <s:Cols Old="256" New="512"/>
80 </s:Sheet>
81 </s:Diff>
82 DIFF
83 });
85 # Expand both
86 &test_command ("$ssconvert --resize=1048576x16384 $src $tmp", sub { 1 } );
87 &test_command ("($ssdiff --xml $src $tmp ; true)",
88 sub {
89 $_ eq <<DIFF
90 <?xml version="1.0" encoding="UTF-8"?>
91 <s:Diff xmlns:s="http://www.gnumeric.org/ssdiff.dtd">
92 <s:Sheet Name="Sheet1" Old="0" New="0">
93 <s:Cols Old="256" New="16384"/>
94 <s:Rows Old="65536" New="1048576"/>
95 </s:Sheet>
96 </s:Diff>
97 DIFF
98 });