writeexcel 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +8 -0
- data/README.rdoc +5 -0
- data/lib/writeexcel/biffwriter.rb +2 -1
- data/lib/writeexcel/chart.rb +2 -3
- data/lib/writeexcel/charts/area.rb +1 -1
- data/lib/writeexcel/charts/pie.rb +1 -1
- data/lib/writeexcel/charts/scatter.rb +1 -1
- data/lib/writeexcel/charts/stock.rb +1 -1
- data/lib/writeexcel/col_info.rb +2 -2
- data/lib/writeexcel/comments.rb +1 -1
- data/lib/writeexcel/convert_date_time.rb +7 -7
- data/lib/writeexcel/excelformulaparser.rb +49 -49
- data/lib/writeexcel/format.rb +1 -1
- data/lib/writeexcel/formula.rb +1 -1
- data/lib/writeexcel/helper.rb +3 -3
- data/lib/writeexcel/properties.rb +1 -1
- data/lib/writeexcel/shared_string_table.rb +5 -5
- data/lib/writeexcel/storage_lite.rb +2 -9
- data/lib/writeexcel/version.rb +1 -1
- data/lib/writeexcel/workbook.rb +13 -14
- data/lib/writeexcel/worksheet.rb +43 -35
- data/test/helper.rb +12 -4
- data/test/test_00_IEEE_double.rb +1 -1
- data/test/test_04_dimensions.rb +2 -2
- data/test/test_05_rows.rb +1 -1
- data/test/test_06_extsst.rb +1 -1
- data/test/test_11_date_time.rb +1 -1
- data/test/test_12_date_only.rb +1 -1
- data/test/test_13_date_seconds.rb +1 -1
- data/test/test_21_escher.rb +1 -1
- data/test/test_22_mso_drawing_group.rb +1 -1
- data/test/test_23_note.rb +1 -1
- data/test/test_24_txo.rb +1 -1
- data/test/test_25_position_object.rb +1 -1
- data/test/test_26_autofilter.rb +1 -1
- data/test/test_27_autofilter.rb +1 -1
- data/test/test_28_autofilter.rb +1 -1
- data/test/test_29_process_jpg.rb +1 -43
- data/test/test_30_validation_dval.rb +1 -1
- data/test/test_31_validation_dv_strings.rb +1 -1
- data/test/test_32_validation_dv_formula.rb +1 -1
- data/test/test_40_property_types.rb +1 -1
- data/test/test_41_properties.rb +1 -1
- data/test/test_42_set_properties.rb +2 -2
- data/test/test_50_name_stored.rb +1 -9
- data/test/test_51_name_print_area.rb +3 -13
- data/test/test_52_name_print_titles.rb +3 -21
- data/test/test_53_autofilter.rb +1 -5
- data/test/test_60_chart_generic.rb +3 -3
- data/test/test_61_chart_subclasses.rb +2 -1
- data/test/test_62_chart_formats.rb +9 -21
- data/test/test_63_chart_area_formats.rb +1 -1
- data/test/test_compatibility.rb +1 -1
- data/test/test_example_match.rb +835 -835
- data/test/test_format.rb +1 -114
- data/test/test_formula.rb +1 -1
- data/test/test_properties.rb +1 -2
- data/test/test_storage_lite.rb +2 -2
- data/test/test_workbook.rb +1 -66
- data/test/test_worksheet.rb +1 -18
- data/test/test_write_formula_does_not_change_formula_string.rb +1 -1
- data/writeexcel.gemspec +3 -2
- metadata +23 -20
- data/test/test_01_add_worksheet.rb +0 -43
- data/test/test_02_merge_formats.rb +0 -49
- data/test/test_biff.rb +0 -71
- data/test/test_big_workbook.rb +0 -17
- data/test/test_ole.rb +0 -102
@@ -19,7 +19,7 @@
|
|
19
19
|
require 'helper'
|
20
20
|
require 'stringio'
|
21
21
|
|
22
|
-
class TC_set_properties < Test
|
22
|
+
class TC_set_properties < Minitest::Test
|
23
23
|
|
24
24
|
def test_dummy
|
25
25
|
assert(true)
|
@@ -42,7 +42,7 @@ class TC_set_properties < Test::Unit::TestCase
|
|
42
42
|
smiley = '☺' # chr 0x263A; in perl
|
43
43
|
|
44
44
|
workbook = WriteExcel.new(@test_file)
|
45
|
-
|
45
|
+
workbook.add_worksheet
|
46
46
|
|
47
47
|
=begin
|
48
48
|
###############################################################################
|
data/test/test_50_name_stored.rb
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
require 'helper'
|
14
14
|
require 'stringio'
|
15
15
|
|
16
|
-
class TC_Name_Stored < Test
|
16
|
+
class TC_Name_Stored < Minitest::Test
|
17
17
|
def setup
|
18
18
|
@test_file = StringIO.new
|
19
19
|
@workbook = WriteExcel.new(@test_file)
|
@@ -21,7 +21,6 @@ class TC_Name_Stored < Test::Unit::TestCase
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_print_area_name_with_simple_range
|
24
|
-
caption = " \tNAME for worksheet1.print_area('A1:B12')"
|
25
24
|
name = [0x06].pack('C')
|
26
25
|
encoding = 0
|
27
26
|
sheet_index = 1
|
@@ -44,7 +43,6 @@ class TC_Name_Stored < Test::Unit::TestCase
|
|
44
43
|
end
|
45
44
|
|
46
45
|
def test_print_area_name_with_simple_range_in_sheet_3
|
47
|
-
caption = " \tNAME for worksheet3.print_area('G7:H8')"
|
48
46
|
name = [0x06].pack('C')
|
49
47
|
encoding = 0
|
50
48
|
sheet_index = 3
|
@@ -68,7 +66,6 @@ class TC_Name_Stored < Test::Unit::TestCase
|
|
68
66
|
end
|
69
67
|
|
70
68
|
def test_for_repeat_rows_name
|
71
|
-
caption = " \tNAME for worksheet1.repeat_rows(0, 9)"
|
72
69
|
name = [0x07].pack('C')
|
73
70
|
encoding = 0
|
74
71
|
sheet_index = 1
|
@@ -92,7 +89,6 @@ class TC_Name_Stored < Test::Unit::TestCase
|
|
92
89
|
end
|
93
90
|
|
94
91
|
def test_for_repeat_rows_name_on_sheet_3
|
95
|
-
caption = " \tNAME for worksheet3.repeat_rows(6, 7)"
|
96
92
|
name = [0x07].pack('C')
|
97
93
|
encoding = 0
|
98
94
|
sheet_index = 1
|
@@ -116,7 +112,6 @@ class TC_Name_Stored < Test::Unit::TestCase
|
|
116
112
|
end
|
117
113
|
|
118
114
|
def test_for_repeat_columns_name
|
119
|
-
caption = " \tNAME for worksheet1.repeat_columns('A:J')"
|
120
115
|
name = [0x07].pack('C')
|
121
116
|
encoding = 0
|
122
117
|
sheet_index = 1
|
@@ -140,7 +135,6 @@ class TC_Name_Stored < Test::Unit::TestCase
|
|
140
135
|
end
|
141
136
|
|
142
137
|
def test_for_repeat_rows_and_repeat_columns_together_name
|
143
|
-
caption = " \tNAME for repeat_rows(1, 2) repeat_columns(3, 4)"
|
144
138
|
name = [0x07].pack('C')
|
145
139
|
encoding = 0
|
146
140
|
sheet_index = 1
|
@@ -165,7 +159,6 @@ class TC_Name_Stored < Test::Unit::TestCase
|
|
165
159
|
end
|
166
160
|
|
167
161
|
def test_for_print_area_name_with_simple_range
|
168
|
-
caption = " \tNAME for worksheet1.autofilter('A1:C5')"
|
169
162
|
name = [0x0D].pack('C')
|
170
163
|
encoding = 0
|
171
164
|
sheet_index = 1
|
@@ -189,7 +182,6 @@ class TC_Name_Stored < Test::Unit::TestCase
|
|
189
182
|
end
|
190
183
|
|
191
184
|
def test_for_define_name_global_name
|
192
|
-
caption = " \tNAME for worksheet1.define_name('Foo', ...)"
|
193
185
|
name = 'Foo'
|
194
186
|
encoding = 0
|
195
187
|
sheet_index = 0
|
@@ -13,7 +13,7 @@
|
|
13
13
|
require 'helper'
|
14
14
|
require 'stringio'
|
15
15
|
|
16
|
-
class TC_Name_Print_Area < Test
|
16
|
+
class TC_Name_Print_Area < Minitest::Test
|
17
17
|
def setup
|
18
18
|
@test_file = StringIO.new
|
19
19
|
@workbook = WriteExcel.new(@test_file)
|
@@ -34,7 +34,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
|
|
34
34
|
17 00 08 00 01 00 00 00 00 00 00 00
|
35
35
|
).join('')].pack('H*')
|
36
36
|
|
37
|
-
caption = " \tExternsheet"
|
38
37
|
result = _unpack_externsheet(@workbook.data)
|
39
38
|
target = _unpack_externsheet(target)
|
40
39
|
assert_equal(target, result)
|
@@ -48,7 +47,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
|
|
48
47
|
00 00 00 06 3B 00 00 00 00 0B 00 00 00 01 00
|
49
48
|
).join('')].pack('H*')
|
50
49
|
|
51
|
-
caption = " \t+ Name ( Sheet1!#{area} )";
|
52
50
|
result = _unpack_name(@workbook.data)
|
53
51
|
target = _unpack_name(target)
|
54
52
|
assert_equal(target, result)
|
@@ -102,7 +100,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
|
|
102
100
|
17 00 08 00 01 00 00 00 00 00 00 00
|
103
101
|
).join('')].pack('H*')
|
104
102
|
|
105
|
-
caption = " \tExternsheet"
|
106
103
|
result = _unpack_externsheet(@workbook.data)
|
107
104
|
target = _unpack_externsheet(target)
|
108
105
|
assert_equal(target, result)
|
@@ -116,7 +113,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
|
|
116
113
|
00 00 00 06 3B 00 00 00 00 FF FF 00 00 00 00
|
117
114
|
).join('')].pack('H*')
|
118
115
|
|
119
|
-
caption = " \t+ Name ( Sheet1!#{area} )";
|
120
116
|
result = _unpack_name(@workbook.data)
|
121
117
|
target = _unpack_name(target)
|
122
118
|
assert_equal(target, result)
|
@@ -136,7 +132,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
|
|
136
132
|
17 00 08 00 01 00 00 00 00 00 00 00
|
137
133
|
).join('')].pack('H*')
|
138
134
|
|
139
|
-
caption = " \tExternsheet"
|
140
135
|
result = _unpack_externsheet(@workbook.data)
|
141
136
|
target = _unpack_externsheet(target)
|
142
137
|
assert_equal(target, result)
|
@@ -150,7 +145,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
|
|
150
145
|
00 00 00 06 3B 00 00 00 00 FF FF 00 00 07 00
|
151
146
|
).join('')].pack('H*')
|
152
147
|
|
153
|
-
caption = " \t+ Name ( Sheet1!#{area} )";
|
154
148
|
result = _unpack_name(@workbook.data)
|
155
149
|
target = _unpack_name(target)
|
156
150
|
assert_equal(target, result)
|
@@ -174,7 +168,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
|
|
174
168
|
01 00 00 00 02 00 02 00
|
175
169
|
).join('')].pack('H*')
|
176
170
|
|
177
|
-
caption = " \tExternsheet"
|
178
171
|
result = _unpack_externsheet(@workbook.data)
|
179
172
|
target = _unpack_externsheet(target)
|
180
173
|
assert_equal(target, result)
|
@@ -194,7 +187,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
|
|
194
187
|
00 00 00 06 3B 02 00 06 00 07 00 06 00 07 00
|
195
188
|
).join('')].pack('H*')
|
196
189
|
|
197
|
-
caption = " \t+ Name ( Sheet1!A1:B2, Sheet2!D4:E5, Sheet3!G7:H8 )";
|
198
190
|
result = _unpack_name(@workbook.data)
|
199
191
|
target = _unpack_name(target)
|
200
192
|
assert_equal(target, result)
|
@@ -202,9 +194,9 @@ class TC_Name_Print_Area < Test::Unit::TestCase
|
|
202
194
|
|
203
195
|
def test_ranges_on_multiple_sheets_with_sheets_spaced_out
|
204
196
|
worksheet1 = @workbook.add_worksheet
|
205
|
-
|
197
|
+
@workbook.add_worksheet
|
206
198
|
worksheet3 = @workbook.add_worksheet
|
207
|
-
|
199
|
+
@workbook.add_worksheet
|
208
200
|
worksheet5 = @workbook.add_worksheet
|
209
201
|
|
210
202
|
worksheet1.print_area('A1:B2')
|
@@ -220,7 +212,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
|
|
220
212
|
02 00 00 00 04 00 04 00
|
221
213
|
).join('')].pack('H*')
|
222
214
|
|
223
|
-
caption = " \tExternsheet"
|
224
215
|
result = _unpack_externsheet(@workbook.data)
|
225
216
|
target = _unpack_externsheet(target)
|
226
217
|
assert_equal(target, result)
|
@@ -240,7 +231,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
|
|
240
231
|
00 00 00 06 3B 02 00 06 00 07 00 06 00 07 00
|
241
232
|
).join('')].pack('H*')
|
242
233
|
|
243
|
-
caption = " \t+ Name ( Sheet1!A1:B2, Sheet3!D4:E5, Sheet5!G7:H8 )";
|
244
234
|
result = _unpack_name(@workbook.data)
|
245
235
|
target = _unpack_name(target)
|
246
236
|
assert_equal(target, result)
|
@@ -13,7 +13,7 @@
|
|
13
13
|
require 'helper'
|
14
14
|
require 'stringio'
|
15
15
|
|
16
|
-
class TC_Name_Print_Titles < Test
|
16
|
+
class TC_Name_Print_Titles < Minitest::Test
|
17
17
|
def setup
|
18
18
|
@test_file = StringIO.new
|
19
19
|
@workbook = WriteExcel.new(@test_file)
|
@@ -33,7 +33,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
33
33
|
17 00 08 00 01 00 00 00 00 00 00 00
|
34
34
|
).join('')].pack('H*')
|
35
35
|
|
36
|
-
caption = " \tExternsheet"
|
37
36
|
result = _unpack_externsheet(@workbook.data)
|
38
37
|
target = _unpack_externsheet(target)
|
39
38
|
assert_equal(target, result)
|
@@ -47,7 +46,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
47
46
|
00 00 00 07 3B 00 00 00 00 00 00 00 00 FF 00
|
48
47
|
).join('')].pack('H*')
|
49
48
|
|
50
|
-
caption = " \t+ Name repeats ( Sheet1!1:1 )";
|
51
49
|
result = _unpack_name(@workbook.data)
|
52
50
|
target = _unpack_name(target)
|
53
51
|
assert_equal(target, result)
|
@@ -66,7 +64,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
66
64
|
17 00 08 00 01 00 00 00 00 00 00 00
|
67
65
|
).join('')].pack('H*')
|
68
66
|
|
69
|
-
caption = " \tExternsheet"
|
70
67
|
result = _unpack_externsheet(@workbook.data)
|
71
68
|
target = _unpack_externsheet(target)
|
72
69
|
assert_equal(target, result)
|
@@ -80,7 +77,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
80
77
|
00 00 00 07 3B 00 00 00 00 09 00 00 00 FF 00
|
81
78
|
).join('')].pack('H*')
|
82
79
|
|
83
|
-
caption = " \t+ Name repeats ( Sheet1!1:10 )";
|
84
80
|
result = _unpack_name(@workbook.data)
|
85
81
|
target = _unpack_name(target)
|
86
82
|
assert_equal(target, result)
|
@@ -99,7 +95,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
99
95
|
17 00 08 00 01 00 00 00 00 00 00 00
|
100
96
|
).join('')].pack('H*')
|
101
97
|
|
102
|
-
caption = " \tExternsheet"
|
103
98
|
result = _unpack_externsheet(@workbook.data)
|
104
99
|
target = _unpack_externsheet(target)
|
105
100
|
assert_equal(target, result)
|
@@ -113,7 +108,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
113
108
|
00 00 00 07 3B 00 00 00 00 FF FF 00 00 00 00
|
114
109
|
).join('')].pack('H*')
|
115
110
|
|
116
|
-
caption = " \t+ Name repeats ( Sheet1!A:A )";
|
117
111
|
result = _unpack_name(@workbook.data)
|
118
112
|
target = _unpack_name(target)
|
119
113
|
assert_equal(target, result)
|
@@ -132,7 +126,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
132
126
|
17 00 08 00 01 00 00 00 00 00 00 00
|
133
127
|
).join('')].pack('H*')
|
134
128
|
|
135
|
-
caption = " \tExternsheet"
|
136
129
|
result = _unpack_externsheet(@workbook.data)
|
137
130
|
target = _unpack_externsheet(target)
|
138
131
|
assert_equal(target, result)
|
@@ -146,7 +139,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
146
139
|
00 00 00 07 3B 00 00 00 00 FF FF 00 00 00 00
|
147
140
|
).join('')].pack('H*')
|
148
141
|
|
149
|
-
caption = " \t+ Name repeats ( Sheet1!A:A )";
|
150
142
|
result = _unpack_name(@workbook.data)
|
151
143
|
target = _unpack_name(target)
|
152
144
|
assert_equal(target, result)
|
@@ -165,7 +157,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
165
157
|
17 00 08 00 01 00 00 00 00 00 00 00
|
166
158
|
).join('')].pack('H*')
|
167
159
|
|
168
|
-
caption = " \tExternsheet"
|
169
160
|
result = _unpack_externsheet(@workbook.data)
|
170
161
|
target = _unpack_externsheet(target)
|
171
162
|
assert_equal(target, result)
|
@@ -179,7 +170,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
179
170
|
00 00 00 07 3B 00 00 00 00 FF FF 00 00 09 00
|
180
171
|
).join('')].pack('H*')
|
181
172
|
|
182
|
-
caption = " \t+ Name repeats ( Sheet1!A:J )";
|
183
173
|
result = _unpack_name(@workbook.data)
|
184
174
|
target = _unpack_name(target)
|
185
175
|
assert_equal(target, result)
|
@@ -198,7 +188,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
198
188
|
17 00 08 00 01 00 00 00 00 00 00 00
|
199
189
|
).join('')].pack('H*')
|
200
190
|
|
201
|
-
caption = " \tExternsheet"
|
202
191
|
result = _unpack_externsheet(@workbook.data)
|
203
192
|
target = _unpack_externsheet(target)
|
204
193
|
assert_equal(target, result)
|
@@ -212,7 +201,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
212
201
|
00 00 00 07 3B 00 00 00 00 FF FF 00 00 09 00
|
213
202
|
).join('')].pack('H*')
|
214
203
|
|
215
|
-
caption = " \t+ Name repeats ( Sheet1!A:J )";
|
216
204
|
result = _unpack_name(@workbook.data)
|
217
205
|
target = _unpack_name(target)
|
218
206
|
assert_equal(target, result)
|
@@ -236,7 +224,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
236
224
|
01 00 00 00 02 00 02 00
|
237
225
|
).join('')].pack('H*')
|
238
226
|
|
239
|
-
caption = " \tExternsheet"
|
240
227
|
result = _unpack_externsheet(@workbook.data)
|
241
228
|
target = _unpack_externsheet(target)
|
242
229
|
assert_equal(target, result)
|
@@ -256,7 +243,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
256
243
|
00 00 00 07 3B 02 00 06 00 07 00 00 00 FF 00
|
257
244
|
).join('')].pack('H*')
|
258
245
|
|
259
|
-
caption = " \t+ Name repeats ( Sheet1!1:2, Sheet2!4:5, Sheet3!7:8 )";
|
260
246
|
result = _unpack_name(@workbook.data)
|
261
247
|
target = _unpack_name(target)
|
262
248
|
assert_equal(target, result)
|
@@ -264,9 +250,9 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
264
250
|
|
265
251
|
def test_repeat_rows_on_multiple_sheets_with_sheets_spaced_out
|
266
252
|
worksheet1 = @workbook.add_worksheet
|
267
|
-
|
253
|
+
@workbook.add_worksheet
|
268
254
|
worksheet3 = @workbook.add_worksheet
|
269
|
-
|
255
|
+
@workbook.add_worksheet
|
270
256
|
worksheet5 = @workbook.add_worksheet
|
271
257
|
|
272
258
|
worksheet1.repeat_rows(0, 1)
|
@@ -282,7 +268,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
282
268
|
02 00 00 00 04 00 04 00
|
283
269
|
).join('')].pack('H*')
|
284
270
|
|
285
|
-
caption = " \tExternsheet"
|
286
271
|
result = _unpack_externsheet(@workbook.data)
|
287
272
|
target = _unpack_externsheet(target)
|
288
273
|
assert_equal(target, result)
|
@@ -302,7 +287,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
302
287
|
00 00 00 07 3B 02 00 06 00 07 00 00 00 FF 00
|
303
288
|
).join('')].pack('H*')
|
304
289
|
|
305
|
-
caption = " \t+ Name repeats ( Sheet1!1:2, Sheet3!4:5, Sheet5!7:8 )";
|
306
290
|
result = _unpack_name(@workbook.data)
|
307
291
|
target = _unpack_name(target)
|
308
292
|
assert_equal(target, result)
|
@@ -322,7 +306,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
322
306
|
17 00 08 00 01 00 00 00 00 00 00 00
|
323
307
|
).join('')].pack('H*')
|
324
308
|
|
325
|
-
caption = " \tExternsheet"
|
326
309
|
result = _unpack_externsheet(@workbook.data)
|
327
310
|
target = _unpack_externsheet(target)
|
328
311
|
assert_equal(target, result)
|
@@ -337,7 +320,6 @@ class TC_Name_Print_Titles < Test::Unit::TestCase
|
|
337
320
|
04 00 3B 00 00 01 00 02 00 00 00 FF 00 10
|
338
321
|
).join('')].pack('H*')
|
339
322
|
|
340
|
-
caption = " \t+ Name repeats ( Sheet1!2:3, Sheet1!D:E )";
|
341
323
|
result = _unpack_name(@workbook.data)
|
342
324
|
target = _unpack_name(target)
|
343
325
|
assert_equal(target, result)
|
data/test/test_53_autofilter.rb
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
require 'helper'
|
14
14
|
require 'stringio'
|
15
15
|
|
16
|
-
class TC_autofilter < Test
|
16
|
+
class TC_autofilter < Minitest::Test
|
17
17
|
def setup
|
18
18
|
@test_file = StringIO.new
|
19
19
|
@workbook = WriteExcel.new(@test_file)
|
@@ -33,7 +33,6 @@ class TC_autofilter < Test::Unit::TestCase
|
|
33
33
|
17 00 08 00 01 00 00 00 00 00 00 00
|
34
34
|
).join('')].pack('H*')
|
35
35
|
|
36
|
-
caption = " \tExternsheet"
|
37
36
|
result = _unpack_externsheet(@workbook.data)
|
38
37
|
target = _unpack_externsheet(target)
|
39
38
|
assert_equal(target, result)
|
@@ -47,7 +46,6 @@ class TC_autofilter < Test::Unit::TestCase
|
|
47
46
|
00 00 00 0D 3B 00 00 00 00 04 00 00 00 02 00
|
48
47
|
).join('')].pack('H*')
|
49
48
|
|
50
|
-
caption = " \t+ Name = autofilter ( Sheet1!A1:C5 )";
|
51
49
|
result = _unpack_name(@workbook.data)
|
52
50
|
target = _unpack_name(target)
|
53
51
|
assert_equal(target, result)
|
@@ -69,7 +67,6 @@ class TC_autofilter < Test::Unit::TestCase
|
|
69
67
|
01 00
|
70
68
|
).join('')].pack('H*')
|
71
69
|
|
72
|
-
caption = " \tExternsheet"
|
73
70
|
result = _unpack_externsheet(@workbook.data)
|
74
71
|
target = _unpack_externsheet(target)
|
75
72
|
assert_equal(target, result)
|
@@ -86,7 +83,6 @@ class TC_autofilter < Test::Unit::TestCase
|
|
86
83
|
00 00 00 0D 3B 01 00 00 00 04 00 00 00 02 00
|
87
84
|
).join('')].pack('H*')
|
88
85
|
|
89
|
-
caption = " \t+ Name = autofilter ( Sheet1!A1:C5, Sheet2!A1:C5 )";
|
90
86
|
result = _unpack_name(@workbook.data)
|
91
87
|
target = _unpack_name(target)
|
92
88
|
assert_equal(target, result)
|
@@ -13,7 +13,7 @@ require 'stringio'
|
|
13
13
|
# original written in Perl by John McNamara
|
14
14
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
15
15
|
#
|
16
|
-
class TC_ChartGeneric < Test
|
16
|
+
class TC_ChartGeneric < Minitest::Test
|
17
17
|
def setup
|
18
18
|
io = StringIO.new
|
19
19
|
workbook = WriteExcel.new(io)
|
@@ -52,7 +52,7 @@ class TC_ChartGeneric < Test::Unit::TestCase
|
|
52
52
|
values = [0x0000, 0x0000, 0x02DD51E0, 0x01C2B838]
|
53
53
|
got = unpack_record(@chart.__send__("store_chart", *values))
|
54
54
|
assert_equal(expected, got, caption)
|
55
|
-
|
55
|
+
end
|
56
56
|
|
57
57
|
###############################################################################
|
58
58
|
#
|
@@ -65,7 +65,7 @@ class TC_ChartGeneric < Test::Unit::TestCase
|
|
65
65
|
).join(' ')
|
66
66
|
got = unpack_record(@chart.__send__("store_series", 8, 8))
|
67
67
|
assert_equal(expected, got, caption)
|
68
|
-
|
68
|
+
end
|
69
69
|
|
70
70
|
###############################################################################
|
71
71
|
#
|
@@ -13,7 +13,8 @@ require 'stringio'
|
|
13
13
|
# original written in Perl by John McNamara
|
14
14
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
15
15
|
#
|
16
|
-
class TC_chart_subclasses < Test
|
16
|
+
class TC_chart_subclasses < Minitest::Test
|
17
|
+
|
17
18
|
def setup
|
18
19
|
io = StringIO.new
|
19
20
|
@workbook = WriteExcel.new(io)
|
@@ -13,7 +13,7 @@ require 'stringio'
|
|
13
13
|
# original written in Perl by John McNamara
|
14
14
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
15
15
|
#
|
16
|
-
class TC_ChartFormats < Test
|
16
|
+
class TC_ChartFormats < Minitest::Test
|
17
17
|
def setup
|
18
18
|
@io = StringIO.new
|
19
19
|
@workbook = WriteExcel.new(@io)
|
@@ -90,25 +90,19 @@ class TC_ChartFormats < Test::Unit::TestCase
|
|
90
90
|
caption1 = " \tChart: index = get_color_indices(#{color})"
|
91
91
|
caption2 = " \tChart: rgb = get_color_indices(#{color})"
|
92
92
|
|
93
|
-
expected_index = nil
|
94
|
-
expected_rgb = nil
|
95
|
-
|
96
93
|
got_index, got_rgb = @chart.__send__("get_color_indices", color)
|
97
94
|
|
98
|
-
|
99
|
-
|
95
|
+
assert_nil(got_index, caption1)
|
96
|
+
assert_nil(got_rgb, caption2)
|
100
97
|
|
101
98
|
color = 64
|
102
99
|
caption1 = " \tChart: index = get_color_indices(#{color})"
|
103
100
|
caption2 = " \tChart: rgb = get_color_indices(#{color})"
|
104
101
|
|
105
|
-
expected_index = nil
|
106
|
-
expected_rgb = nil
|
107
|
-
|
108
102
|
got_index, got_rgb = @chart.__send__("get_color_indices", color)
|
109
103
|
|
110
|
-
|
111
|
-
|
104
|
+
assert_nil(got_index, caption1)
|
105
|
+
assert_nil(got_rgb, caption2)
|
112
106
|
end
|
113
107
|
|
114
108
|
###############################################################################
|
@@ -120,13 +114,10 @@ class TC_ChartFormats < Test::Unit::TestCase
|
|
120
114
|
caption1 = " \tChart: index = get_color_indices(#{color})"
|
121
115
|
caption2 = " \tChart: rgb = get_color_indices(#{color})"
|
122
116
|
|
123
|
-
expected_index = nil
|
124
|
-
expected_rgb = nil
|
125
|
-
|
126
117
|
got_index, got_rgb = @chart.__send__("get_color_indices", color)
|
127
118
|
|
128
|
-
|
129
|
-
|
119
|
+
assert_nil(got_index, caption1)
|
120
|
+
assert_nil(got_rgb, caption2)
|
130
121
|
end
|
131
122
|
|
132
123
|
###############################################################################
|
@@ -138,13 +129,10 @@ class TC_ChartFormats < Test::Unit::TestCase
|
|
138
129
|
caption1 = " \tChart: index = get_color_indices(#{color})"
|
139
130
|
caption2 = " \tChart: rgb = get_color_indices(#{color})"
|
140
131
|
|
141
|
-
expected_index = nil
|
142
|
-
expected_rgb = nil
|
143
|
-
|
144
132
|
got_index, got_rgb = @chart.__send__("get_color_indices", color)
|
145
133
|
|
146
|
-
|
147
|
-
|
134
|
+
assert_nil(got_index, caption1)
|
135
|
+
assert_nil(got_rgb, caption2)
|
148
136
|
end
|
149
137
|
|
150
138
|
###############################################################################
|
@@ -13,7 +13,7 @@ require 'stringio'
|
|
13
13
|
# original written in Perl by John McNamara
|
14
14
|
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
15
15
|
#
|
16
|
-
class TC_ChartAreaFormats < Test
|
16
|
+
class TC_ChartAreaFormats < Minitest::Test
|
17
17
|
def setup
|
18
18
|
@io = StringIO.new
|
19
19
|
@workbook = WriteExcel.new(@io)
|