Skip to content
This repository has been archived by the owner on Dec 5, 2017. It is now read-only.

Commit

Permalink
version bump 0.3.2: XLSX 0.7.2, XLS 0.6.18
Browse files Browse the repository at this point in the history
- Multi-format tests include CSV comparisons
- Travis also tests 0.11
- Slow tests removed to run within Travis time limit
- MFT no-csv / yes-csv options
  • Loading branch information
SheetJSDev committed May 22, 2014
1 parent 43e7361 commit a718730
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 36 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: node_js
node_js:
- "0.10"
- "0.8"
- "0.11"
before_install:
- "npm install -g mocha"
- "npm install blanket"
Expand Down
4 changes: 4 additions & 0 deletions multiformat.lst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ AutoFilter .xls .xlsb .xlsx .xml
#BlankSheetTypes .xls .xlsb .xlsx .xml
RkNumber .xls .xlsb .xlsx .xls.xml .xlsb.xml .xlsx.xml
#calendar_stress_test .xls .xlsb .xlsx .xml
# no-csv (newline character \r vs \n)
comments_stress_test .xls .xlsb .xlsx .xls.xml .xlsb.xml .xlsx.xml
# yes-csv
custom_properties .xls .xlsb .xlsx .xls.xml .xlsb.xml .xlsx.xml
#formula_stress_test .xls .xlsb .xlsx .xls.xml .xlsb.xml .xlsx.xml
hyperlink_stress_test_2011 .xls .xlsb .xlsx .xml
#large_strings .xls .xlsb .xlsx .xls.xml .xlsb.xml .xlsx.xml
merge_cells .xls .xlsb .xlsx .xls.xml .xlsb.xml .xlsx.xml
named_ranges_2011 .xls .xlsb .xlsx .xls.xml .xlsb.xml .xlsx.xml
# no-csv (macro serialization in xml)
number_format .xls .xlsb .xlsm .xls.xml .xlsb.xml .xlsm.xml
# yes-csv
pivot_table_named_range .xls .xlsb .xlsx .xml
pivot_table_test .xls .xlsb .xlsm
rich_text_stress .xls .xlsb .xlsx .xls.xml .xlsb.xml .xlsx.xml
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "j",
"version": "0.3.1",
"version": "0.3.2",
"author": "sheetjs",
"description": "data wrangler",
"keywords": [ "xls", "xlsx", "xlsm", "xlsb", "office", "excel", "spreadsheet" ],
Expand All @@ -10,7 +10,7 @@
"main": "./j",
"dependencies": {
"xlsjs": "~0.6.18",
"xlsx": "~0.7.1",
"xlsx": "~0.7.2",
"commander":""
},
"devDependencies": {
Expand Down
58 changes: 37 additions & 21 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,52 @@ files.forEach(function(x) {
wbxlsm = J.readFile(dir + x + "__.xlsm", opts);
});

it.skip('should round-trip XLSB', x.substr(-8) == ".pending" || x.substr(-8) == ".nowrite" ? null : function() {
/*it.skip('should round-trip XLSB', x.substr(-8) == ".pending" || x.substr(-8) == ".nowrite" ? null : function() {
fs.writeFileSync(dir + x + "__.xlsb", J.utils.to_xlsb(wb, {}));
wbxlsb = J.readFile(dir + x + "__.xlsb", opts);
});
});*/
});
});

function cmparr(x){ for(var i=1;i!=x.length;++i) assert.deepEqual(x[0], x[i]); }

var mfopts = opts;
var mft = fs.readFileSync('multiformat.lst','utf-8').split("\n");
mft.forEach(function(x) { if(x[0]!="#") describe('MFT ' + x, function() {
var fil = {}, f = [], r = x.split(/\s+/);
if(r.length < 3) return;
it('should parse all', function() {
for(var j = 1; j != r.length; ++j) f[j-1] = J.readFile(dir + r[0] + r[j], mfopts);
});
it('should have the same sheetnames', function() {
cmparr(f.map(function(x) { return x[1].SheetNames; }));
});
it('should have the same ranges', function() {
f[0][1].SheetNames.forEach(function(s) {
var ss = f.map(function(x) { return x[1].Sheets[s]; });
cmparr(ss.map(function(s) { return s['!ref']; }));
var csv = true;
mft.forEach(function(x) {
if(x[0]!="#") describe('MFT ' + x, function() {
var fil = {}, f = [], r = x.split(/\s+/);
if(r.length < 3) return;
it('should parse all', function() {
for(var j = 1; j != r.length; ++j) f[j-1] = J.readFile(dir + r[0] + r[j], mfopts);
});
});
it('should have the same merges', function() {
f[0][1].SheetNames.forEach(function(s) {
var ss = f.map(function(x) { return x[1].Sheets[s]; });
cmparr(ss.map(function(s) { return (s['!merges']||[]).map(function(y) { return J.XLS.utils.encode_range(y); }).sort(); }));
it('should have the same sheetnames', function() {
cmparr(f.map(function(x) { return x[1].SheetNames; }));
});
it('should have the same ranges', function() {
f[0][1].SheetNames.forEach(function(s) {
var ss = f.map(function(x) { return x[1].Sheets[s]; });
cmparr(ss.map(function(s) { return s['!ref']; }));
});
});
it('should have the same merges', function() {
f[0][1].SheetNames.forEach(function(s) {
var ss = f.map(function(x) { return x[1].Sheets[s]; });
cmparr(ss.map(function(s) { return (s['!merges']||[]).map(function(y) { return J.XLS.utils.encode_range(y); }).sort(); }));
});
});
it('should have the same CSV', csv ? function() {
cmparr(f.map(function(x) { return x[1].SheetNames; }));
var names = f[0][1].SheetNames;
names.forEach(function(name) {
cmparr(f.map(function(x) { return J.utils.to_csv(x)[name]; }));
});
} : null);
});
}); });
else {
x.split(/\s+/).forEach(function(w) { switch(w) {
case "no-csv": csv = false; break;
case "yes-csv": csv = true; break;
}});
}
});
128 changes: 115 additions & 13 deletions tests.lst
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ apachepoi_47668.xlsx
apachepoi_47701.xls
apachepoi_47737.xlsx
apachepoi_47804.xlsx
apachepoi_47813.xlsx
apachepoi_47813.xlsx.pending
apachepoi_47847.xls
apachepoi_47862.xlsx
apachepoi_47889.xlsx
Expand Down Expand Up @@ -209,7 +209,7 @@ apachepoi_51222.xlsx
apachepoi_51461.xls
apachepoi_51470.xlsx
apachepoi_51498.xls
apachepoi_51535.xls
apachepoi_51535.xls.pending
apachepoi_51585.xlsx
apachepoi_51670.xls
apachepoi_51675.xls
Expand All @@ -229,6 +229,7 @@ apachepoi_53404.xls
apachepoi_53446.xls
apachepoi_53568.xlsx
apachepoi_53588.xls
apachepoi_53691.xls
apachepoi_53734.xlsx
apachepoi_53798.xlsx
apachepoi_53798_shiftNegative_TMPL.xls
Expand Down Expand Up @@ -257,7 +258,14 @@ apachepoi_55927.xlsx
apachepoi_56011.xlsx
apachepoi_56017.xlsx
apachepoi_56169.xlsx
apachepoi_56170.xlsx
apachepoi_56274.xlsx
apachepoi_56278.xlsx
apachepoi_56315.xlsx
apachepoi_56325.xls
apachepoi_56450.xls
apachepoi_56482.xls
apachepoi_56514.xlsx
apachepoi_AbnormalSharedFormulaFlag.xls
apachepoi_AreaErrPtg.xls
apachepoi_AverageTaxRates.xlsx
Expand Down Expand Up @@ -397,7 +405,7 @@ apachepoi_atp.xls
apachepoi_atp.xlsx
apachepoi_blankworkbook.xls
apachepoi_bug_42794.xls
apachepoi_chart_sheet.xlsx
apachepoi_chart_sheet.xlsx.pending
apachepoi_colwidth.xls
apachepoi_comments.xls
apachepoi_comments.xlsx
Expand All @@ -418,7 +426,7 @@ apachepoi_ex44921-21902.xls
apachepoi_ex45046-21984.xls
apachepoi_ex45582-22397.xls
apachepoi_ex45672.xls
apachepoi_ex45698-22488.xls
apachepoi_ex45698-22488.xls.pending
apachepoi_ex45978-extraLinkTableSheets.xls
apachepoi_ex46548-23133.xls
apachepoi_ex47747-sharedFormula.xls
Expand Down Expand Up @@ -464,11 +472,10 @@ apachepoi_workbookProtection_workbook_structure_protected.xlsx
apachepoi_workbookProtection_workbook_windows_protected.xlsx
apachepoi_workbookProtection_worksheet_protected.xlsx
apachepoi_xlsx-jdbc.xlsx
apachepoi_xor-encryption-abc.xls.pending
apachepoi_yearfracExamples.xls
calendar_stress_test.xls.pending
calendar_stress_test.xlsb.pending
calendar_stress_test.xlsx
calendar_stress_test.xlsx.nowrite
calendar_stress_test.xml.nowrite
comments_stress_test.xls
comments_stress_test.xls.xml
Expand Down Expand Up @@ -612,12 +619,104 @@ jxls-src_report.xls
jxls-src_report_output.xls
jxls-src_rowstyle.xls
jxls-src_rowstyle_output.xls
large_strings.xls.nowrite
large_strings.xls.xml.nowrite
large_strings.xlsb.nowrite
large_strings.xlsb.xml.nowrite
large_strings.xlsx.nowrite
large_strings.xlsx.xml.nowrite
large_strings.xls.pending
large_strings.xls.xml.pending
large_strings.xlsb.pending
large_strings.xlsb.xml.pending
large_strings.xlsx.pending
large_strings.xlsx.xml.pending
libreoffice_calc_cell-value-validation.xls
libreoffice_calc_chart-percent-stacked-with-line-chart.xls
libreoffice_calc_chart-update-invisible-cells.xls
libreoffice_calc_chart_complex-category-column-graph-repeating-values.xls
libreoffice_calc_chart_complex-category-column-graph.xls
libreoffice_calc_cjk-text_cell-justify-distributed-single.xls
libreoffice_calc_cjk-text_cell-justify-distributed-single.xlsx
libreoffice_calc_cjk-text_cell-justify-distributed.xls
libreoffice_calc_conditional-formatting.xls
libreoffice_calc_conditional-formatting.xlsx
libreoffice_calc_conditional-formatting_all_icon_sets.xlsx
libreoffice_calc_csv-import_malformed-quotes.xls.pending
libreoffice_calc_data-pilot_field-cell-format.xls
libreoffice_calc_data-pilot_getpivotdata-cell-function.xls
libreoffice_calc_data-pilot_named-range-as-data-source.xls
libreoffice_calc_data-pilot_simple-range-as-data-source.xls
libreoffice_calc_data-pilot_unlimited-data-fields.xls
libreoffice_calc_dbf_numeric-field-with-zero.xls
libreoffice_calc_drawing-object_connector-arrows.xls
libreoffice_calc_drawing-object_rectangle-over-sized-rows-columns.xls
libreoffice_calc_drawing-object_round-rectangle.xls
libreoffice_calc_drawing-object_shapes.xls
libreoffice_calc_drawing-object_shapes.xlsx
libreoffice_calc_equation-single.xls
libreoffice_calc_export-millon-rows.xlsx.pending
libreoffice_calc_external-ref_access-basic-range-func.xls
libreoffice_calc_external-ref_access-basic-single-cell.xls
libreoffice_calc_external-ref_access-basic-single-func.xls
libreoffice_calc_external-ref_access-basic.xls
libreoffice_calc_external-ref_access-basic.xlsx
libreoffice_calc_external-ref_circular-link-doc1.xls
libreoffice_calc_external-ref_circular-link-doc2.xls
libreoffice_calc_external-ref_extdata.xls
libreoffice_calc_external-ref_extdata.xlsx
libreoffice_calc_external-ref_range-name-extdata.xls
libreoffice_calc_external-ref_range-name.xls
libreoffice_calc_function_linest-excel.xls
libreoffice_calc_function_logest-excel.xls
libreoffice_calc_function_matrix_inline-array-single.xls
libreoffice_calc_function_matrix_inline-arrays-softmaker.xls
libreoffice_calc_function_matrix_inline-arrays.xls
libreoffice_calc_function_n.xls
libreoffice_calc_function_phonetic-richtext.xls
libreoffice_calc_function_phonetic-single.xls
libreoffice_calc_function_phonetic.xls
libreoffice_calc_function_trend-growth-excel.xls
libreoffice_calc_import-wrapped-text.xls
libreoffice_calc_named-range_sheet-local.xls
libreoffice_calc_outline_col-outline-nested.xls
libreoffice_calc_outline_col-outline-single-left-button.xls
libreoffice_calc_outline_col-outline-single.xls
libreoffice_calc_outline_row-outline-nested.xls
libreoffice_calc_outline_row-outline-single-top-button.xls
libreoffice_calc_outline_row-outline-single.xls
libreoffice_calc_print-layout_arial-10-1p.xls
libreoffice_calc_print-layout_arial-10-2p.xls
libreoffice_calc_print-layout_arial-11-1p.xls
libreoffice_calc_print-layout_arial-11-2p.xls
libreoffice_calc_print-layout_arial-12-1p.xls
libreoffice_calc_print-layout_arial-8-1p.xls
libreoffice_calc_print-layout_arial-9-1p.xls
libreoffice_calc_string-number.xls
libreoffice_calc_subtotals_two-on-one-sheet.xls
libreoffice_calc_tab-color.xls
libreoffice_calc_tab-color.xlsx
libreoffice_calc_text-angled-with-border.xls
libreoffice_calc_text-angled-with-border.xlsx
libreoffice_calc_xls-import_300-worksheets.xls
libreoffice_calc_xls-import_autofilter-range.xls
libreoffice_calc_xls-import_cell-border-thickness.xls
libreoffice_calc_xls-import_paste-link_link.xls
libreoffice_calc_xls-import_paste-link_src.xls
libreoffice_calc_xls-import_pivot-cache-has-source.xls
libreoffice_calc_xls-import_pivot-cache-no-source.xls
libreoffice_calc_xls-import_pivot-dup-data-fields.xls
libreoffice_calc_xls-import_pivot-layout-field-non-default.xls
libreoffice_calc_xls-import_row-attributes_row-all-hidden.xls
libreoffice_calc_xls-import_row-attributes_row-filtered.xls
libreoffice_calc_xls-import_row-attributes_row-heights.xls
libreoffice_calc_xls-import_row-attributes_row-tail-hidden-2.xls
libreoffice_calc_xls-import_row-attributes_row-tail-hidden-last-row-visible.xls
libreoffice_calc_xls-import_row-attributes_row-tail-hidden.xls
libreoffice_calc_xls-import_row-attributes_row-top-bottom-hidden.xls
libreoffice_calc_xls-import_shared-formula_1.xls
libreoffice_calc_xls-import_shared-formulas-simple.xls
libreoffice_calc_xlsx-export-single-cell-at-last-row.xlsx
libreoffice_calc_xlsx-import_format-as-table.xlsx
libreoffice_calc_xlsx-import_named-range.xlsx
libreoffice_calc_xlsx-import_perf_300000_line_sample.xlsx.pending
libreoffice_calc_xlsx-import_perf_8-by-300000-cells.xlsx.pending
libreoffice_calc_xlsx-import_perf_pivot-table-with-large-unique-entries.xlsx
libreoffice_calc_xlsx-import_shared-formula_1.xlsx
merge_cells.xls
merge_cells.xls.xml
merge_cells.xlsb
Expand Down Expand Up @@ -663,10 +762,13 @@ openpyxl_g_guess_types.xlsx
openpyxl_g_libreoffice_nrt.xlsx
openpyxl_g_merge_range.xlsx
openpyxl_r_bigfoot.xlsx.pending
openpyxl_r_bug137.xlsx
openpyxl_r_bug275.xlsx
openpyxl_r_bug304.xlsx.pending
openpyxl_r_comments.xlsx
openpyxl_r_complex-styles.xlsx
openpyxl_r_conditional-formatting.xlsx
openpyxl_r_contains_chartsheets.xlsx
openpyxl_r_contains_chartsheets.xlsx.pending
openpyxl_r_date_1900.xlsx
openpyxl_r_date_1904.xlsx
openpyxl_r_formulae.xlsx
Expand Down

0 comments on commit a718730

Please sign in to comment.