xlsx-template
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -553,3 +553,3 @@ /*jshint globalstrict:true, devel:true */ | ||
cell.attrib.t = "s"; | ||
cellValue.text = self.stringIndex(stringified); | ||
cellValue.text = Number(self.stringIndex(stringified)).toString(); | ||
} | ||
@@ -556,0 +556,0 @@ |
{ | ||
"name": "xlsx-template", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Generate .xlsx (Excel) files from templates built in Excel", | ||
@@ -27,3 +27,3 @@ "main": "./lib/index", | ||
"devDependencies": { | ||
"buster": "0.6.12", | ||
"buster": "0.7.6", | ||
"grunt": "~0.4.1", | ||
@@ -30,0 +30,0 @@ "grunt-buster": "~0.2.1" |
@@ -142,4 +142,9 @@ # XLSX Template | ||
### Version 0.0.2 | ||
* Fix a potential issue with the typing of string indices that could cause the | ||
first string to not render correctly if it contained a substitution. | ||
### Version 0.0.1 | ||
* Initial release |
/*jshint globalstrict:true, devel:true */ | ||
/*global require, module, exports, process, __dirname, describe, before, after, it, expect */ | ||
/*global require, module, exports, process, __dirname, describe, before, after, it */ | ||
"use strict"; | ||
@@ -26,6 +26,6 @@ | ||
fs.readFile(path.join(__dirname, 'templates', 't1.xlsx'), function(err, data) { | ||
expect(err).toBeNull(); | ||
buster.expect(err).toBeNull(); | ||
var t = new XlsxTemplate(data); | ||
expect(t.sharedStrings).toEqual([ | ||
buster.expect(t.sharedStrings).toEqual([ | ||
"Name", "Role", "Plan table", "${table:planData.name}", | ||
@@ -45,3 +45,3 @@ "${table:planData.role}", "${table:planData.days}", | ||
fs.readFile(path.join(__dirname, 'templates', 't1.xlsx'), function(err, data) { | ||
expect(err).toBeNull(); | ||
buster.expect(err).toBeNull(); | ||
@@ -55,4 +55,4 @@ var t = new XlsxTemplate(data); | ||
var text = t.archive.file("xl/sharedStrings.xml").asText(); | ||
expect(text).not.toMatch("<si><t>Plan table</t></si>"); | ||
expect(text).toMatch("<si><t>The plan</t></si>"); | ||
buster.expect(text).not.toMatch("<si><t>Plan table</t></si>"); | ||
buster.expect(text).toMatch("<si><t>The plan</t></si>"); | ||
@@ -67,3 +67,3 @@ done(); | ||
fs.readFile(path.join(__dirname, 'templates', 't1.xlsx'), function(err, data) { | ||
expect(err).toBeNull(); | ||
buster.expect(err).toBeNull(); | ||
@@ -100,4 +100,4 @@ var t = new XlsxTemplate(data); | ||
// extract date placeholder - interpolated into string referenced at B4 | ||
expect(sheet1.find("./sheetData/row/c[@r='B4']").attrib.t).toEqual("s"); | ||
expect( | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='B4']").attrib.t).toEqual("s"); | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -109,17 +109,17 @@ parseInt(sheet1.find("./sheetData/row/c[@r='B4']/v").text, 10) | ||
// revision placeholder - cell C4 changed from string to number | ||
expect(sheet1.find("./sheetData/row/c[@r='C4']").attrib.t).toEqual("n"); | ||
expect(sheet1.find("./sheetData/row/c[@r='C4']/v").text).toEqual("10"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C4']").attrib.t).toEqual("n"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C4']/v").text).toEqual("10"); | ||
// dates placeholder - added cells | ||
expect(sheet1.find("./sheetData/row/c[@r='D6']").attrib.t).toEqual("d"); | ||
expect(sheet1.find("./sheetData/row/c[@r='E6']").attrib.t).toEqual("d"); | ||
expect(sheet1.find("./sheetData/row/c[@r='F6']").attrib.t).toEqual("d"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='D6']").attrib.t).toEqual("d"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='E6']").attrib.t).toEqual("d"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='F6']").attrib.t).toEqual("d"); | ||
expect(sheet1.find("./sheetData/row/c[@r='D6']/v").text).toEqual(new Date("2013-01-01").toISOString()); | ||
expect(sheet1.find("./sheetData/row/c[@r='E6']/v").text).toEqual(new Date("2013-01-02").toISOString()); | ||
expect(sheet1.find("./sheetData/row/c[@r='F6']/v").text).toEqual(new Date("2013-01-03").toISOString()); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='D6']/v").text).toEqual(new Date("2013-01-01").toISOString()); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='E6']/v").text).toEqual(new Date("2013-01-02").toISOString()); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='F6']/v").text).toEqual(new Date("2013-01-03").toISOString()); | ||
// planData placeholder - added rows and cells | ||
expect(sheet1.find("./sheetData/row/c[@r='B7']").attrib.t).toEqual("s"); | ||
expect( | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='B7']").attrib.t).toEqual("s"); | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -129,4 +129,4 @@ parseInt(sheet1.find("./sheetData/row/c[@r='B7']/v").text, 10) | ||
).toEqual("John Smith"); | ||
expect(sheet1.find("./sheetData/row/c[@r='B8']").attrib.t).toEqual("s"); | ||
expect( | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='B8']").attrib.t).toEqual("s"); | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -136,4 +136,4 @@ parseInt(sheet1.find("./sheetData/row/c[@r='B8']/v").text, 10) | ||
).toEqual("James Smith"); | ||
expect(sheet1.find("./sheetData/row/c[@r='B9']").attrib.t).toEqual("s"); | ||
expect( | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='B9']").attrib.t).toEqual("s"); | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -144,4 +144,4 @@ parseInt(sheet1.find("./sheetData/row/c[@r='B9']/v").text, 10) | ||
expect(sheet1.find("./sheetData/row/c[@r='C7']").attrib.t).toEqual("s"); | ||
expect( | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C7']").attrib.t).toEqual("s"); | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -151,4 +151,4 @@ parseInt(sheet1.find("./sheetData/row/c[@r='C7']/v").text, 10) | ||
).toEqual("Developer"); | ||
expect(sheet1.find("./sheetData/row/c[@r='C8']").attrib.t).toEqual("s"); | ||
expect( | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C8']").attrib.t).toEqual("s"); | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -158,4 +158,4 @@ parseInt(sheet1.find("./sheetData/row/c[@r='C8']/v").text, 10) | ||
).toEqual("Analyst"); | ||
expect(sheet1.find("./sheetData/row/c[@r='C9']").attrib.t).toEqual("s"); | ||
expect( | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C9']").attrib.t).toEqual("s"); | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -166,22 +166,22 @@ parseInt(sheet1.find("./sheetData/row/c[@r='C9']/v").text, 10) | ||
expect(sheet1.find("./sheetData/row/c[@r='D7']").attrib.t).toEqual("n"); | ||
expect(sheet1.find("./sheetData/row/c[@r='D7']/v").text).toEqual("8"); | ||
expect(sheet1.find("./sheetData/row/c[@r='D8']").attrib.t).toEqual("n"); | ||
expect(sheet1.find("./sheetData/row/c[@r='D8']/v").text).toEqual("4"); | ||
expect(sheet1.find("./sheetData/row/c[@r='D9']").attrib.t).toEqual("n"); | ||
expect(sheet1.find("./sheetData/row/c[@r='D9']/v").text).toEqual("4"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='D7']").attrib.t).toEqual("n"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='D7']/v").text).toEqual("8"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='D8']").attrib.t).toEqual("n"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='D8']/v").text).toEqual("4"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='D9']").attrib.t).toEqual("n"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='D9']/v").text).toEqual("4"); | ||
expect(sheet1.find("./sheetData/row/c[@r='E7']").attrib.t).toEqual("n"); | ||
expect(sheet1.find("./sheetData/row/c[@r='E7']/v").text).toEqual("8"); | ||
expect(sheet1.find("./sheetData/row/c[@r='E8']").attrib.t).toEqual("n"); | ||
expect(sheet1.find("./sheetData/row/c[@r='E8']/v").text).toEqual("4"); | ||
expect(sheet1.find("./sheetData/row/c[@r='E9']").attrib.t).toEqual("n"); | ||
expect(sheet1.find("./sheetData/row/c[@r='E9']/v").text).toEqual("4"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='E7']").attrib.t).toEqual("n"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='E7']/v").text).toEqual("8"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='E8']").attrib.t).toEqual("n"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='E8']/v").text).toEqual("4"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='E9']").attrib.t).toEqual("n"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='E9']/v").text).toEqual("4"); | ||
expect(sheet1.find("./sheetData/row/c[@r='F7']").attrib.t).toEqual("n"); | ||
expect(sheet1.find("./sheetData/row/c[@r='F7']/v").text).toEqual("4"); | ||
expect(sheet1.find("./sheetData/row/c[@r='F8']").attrib.t).toEqual("n"); | ||
expect(sheet1.find("./sheetData/row/c[@r='F8']/v").text).toEqual("4"); | ||
expect(sheet1.find("./sheetData/row/c[@r='F9']").attrib.t).toEqual("n"); | ||
expect(sheet1.find("./sheetData/row/c[@r='F9']/v").text).toEqual("4"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='F7']").attrib.t).toEqual("n"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='F7']/v").text).toEqual("4"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='F8']").attrib.t).toEqual("n"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='F8']/v").text).toEqual("4"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='F9']").attrib.t).toEqual("n"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='F9']/v").text).toEqual("4"); | ||
@@ -199,3 +199,3 @@ // XXX: For debugging only | ||
fs.readFile(path.join(__dirname, 'templates', 'test-cols.xlsx'), function(err, data) { | ||
expect(err).toBeNull(); | ||
buster.expect(err).toBeNull(); | ||
@@ -217,7 +217,7 @@ var t = new XlsxTemplate(data); | ||
// C4 should have moved left, and the old B4 should now be deleted | ||
expect(sheet1.find("./sheetData/row/c[@r='B4']/v").text).toEqual("101"); | ||
expect(sheet1.find("./sheetData/row/c[@r='C4']")).toBeNull(); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='B4']/v").text).toEqual("101"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C4']")).toBeNull(); | ||
// C5 should have moved right, and the old B5 should now be expanded | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -227,3 +227,3 @@ parseInt(sheet1.find("./sheetData/row/c[@r='B5']/v").text, 10) | ||
).toEqual("one"); | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -233,7 +233,7 @@ parseInt(sheet1.find("./sheetData/row/c[@r='C5']/v").text, 10) | ||
).toEqual("two"); | ||
expect(sheet1.find("./sheetData/row/c[@r='D5']/v").text).toEqual("102"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='D5']/v").text).toEqual("102"); | ||
// C6 should not have moved, and the old B6 should be replaced | ||
expect(sheet1.find("./sheetData/row/c[@r='B6']/v").text).toEqual("10"); | ||
expect(sheet1.find("./sheetData/row/c[@r='C6']/v").text).toEqual("103"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='B6']/v").text).toEqual("10"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C6']/v").text).toEqual("103"); | ||
@@ -251,3 +251,3 @@ // XXX: For debugging only | ||
fs.readFile(path.join(__dirname, 'templates', 'test-tables.xlsx'), function(err, data) { | ||
expect(err).toBeNull(); | ||
buster.expect(err).toBeNull(); | ||
@@ -274,6 +274,6 @@ var t = new XlsxTemplate(data); | ||
// Marker above table hasn't moved | ||
expect(sheet1.find("./sheetData/row/c[@r='B4']/v").text).toEqual("101"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='B4']/v").text).toEqual("101"); | ||
// Headers on row 6 haven't moved | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -283,3 +283,3 @@ parseInt(sheet1.find("./sheetData/row/c[@r='B6']/v").text, 10) | ||
).toEqual("Name"); | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -289,3 +289,3 @@ parseInt(sheet1.find("./sheetData/row/c[@r='C6']/v").text, 10) | ||
).toEqual("Age"); | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -295,3 +295,3 @@ parseInt(sheet1.find("./sheetData/row/c[@r='E6']/v").text, 10) | ||
).toEqual("Name"); | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -303,3 +303,3 @@ parseInt(sheet1.find("./sheetData/row/c[@r='F6']/v").text, 10) | ||
// Rows 7 contains table values for the two tables, plus the original marker in G7 | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -309,5 +309,5 @@ parseInt(sheet1.find("./sheetData/row/c[@r='B7']/v").text, 10) | ||
).toEqual("John"); | ||
expect(sheet1.find("./sheetData/row/c[@r='C7']/v").text).toEqual("10"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C7']/v").text).toEqual("10"); | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -317,8 +317,8 @@ parseInt(sheet1.find("./sheetData/row/c[@r='E7']/v").text, 10) | ||
).toEqual("John"); | ||
expect(sheet1.find("./sheetData/row/c[@r='F7']/v").text).toEqual("100"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='F7']/v").text).toEqual("100"); | ||
expect(sheet1.find("./sheetData/row/c[@r='G7']/v").text).toEqual("102"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='G7']/v").text).toEqual("102"); | ||
// Row 8 contains table values, and no markers | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -328,5 +328,5 @@ parseInt(sheet1.find("./sheetData/row/c[@r='B8']/v").text, 10) | ||
).toEqual("Bob"); | ||
expect(sheet1.find("./sheetData/row/c[@r='C8']/v").text).toEqual("2"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C8']/v").text).toEqual("2"); | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -336,11 +336,11 @@ parseInt(sheet1.find("./sheetData/row/c[@r='E8']/v").text, 10) | ||
).toEqual("Bob"); | ||
expect(sheet1.find("./sheetData/row/c[@r='F8']/v").text).toEqual("110"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='F8']/v").text).toEqual("110"); | ||
expect(sheet1.find("./sheetData/row/c[@r='G8']")).toBeNull(); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='G8']")).toBeNull(); | ||
// Row 9 contains no values for the first table, and again no markers | ||
expect(sheet1.find("./sheetData/row/c[@r='B9']")).toBeNull(); | ||
expect(sheet1.find("./sheetData/row/c[@r='C9']")).toBeNull(); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='B9']")).toBeNull(); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C9']")).toBeNull(); | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -350,13 +350,13 @@ parseInt(sheet1.find("./sheetData/row/c[@r='E9']/v").text, 10) | ||
).toEqual("Jim"); | ||
expect(sheet1.find("./sheetData/row/c[@r='F9']/v").text).toEqual("120"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='F9']/v").text).toEqual("120"); | ||
expect(sheet1.find("./sheetData/row/c[@r='G8']")).toBeNull(); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='G8']")).toBeNull(); | ||
// Row 12 contains two blank cells and a marker | ||
expect(sheet1.find("./sheetData/row/c[@r='B12']/v")).toBeNull(); | ||
expect(sheet1.find("./sheetData/row/c[@r='C12']/v")).toBeNull(); | ||
expect(sheet1.find("./sheetData/row/c[@r='D12']/v").text).toEqual("103"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='B12']/v")).toBeNull(); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C12']/v")).toBeNull(); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='D12']/v").text).toEqual("103"); | ||
// Row 15 contains a name, two dates, and a placeholder that was shifted to the right | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -366,8 +366,8 @@ parseInt(sheet1.find("./sheetData/row/c[@r='B15']/v").text, 10) | ||
).toEqual("John"); | ||
expect(sheet1.find("./sheetData/row/c[@r='C15']/v").text).toEqual(new Date("2013-01-01").toISOString()); | ||
expect(sheet1.find("./sheetData/row/c[@r='D15']/v").text).toEqual(new Date("2013-01-02").toISOString()); | ||
expect(sheet1.find("./sheetData/row/c[@r='E15']/v").text).toEqual("104"); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C15']/v").text).toEqual(new Date("2013-01-01").toISOString()); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='D15']/v").text).toEqual(new Date("2013-01-02").toISOString()); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='E15']/v").text).toEqual("104"); | ||
// Row 16 contains a name and three dates | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -377,8 +377,8 @@ parseInt(sheet1.find("./sheetData/row/c[@r='B16']/v").text, 10) | ||
).toEqual("Bob"); | ||
expect(sheet1.find("./sheetData/row/c[@r='C16']/v").text).toEqual(new Date("2013-01-01").toISOString()); | ||
expect(sheet1.find("./sheetData/row/c[@r='D16']/v").text).toEqual(new Date("2013-01-02").toISOString()); | ||
expect(sheet1.find("./sheetData/row/c[@r='E16']/v").text).toEqual(new Date("2013-01-03").toISOString()); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C16']/v").text).toEqual(new Date("2013-01-01").toISOString()); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='D16']/v").text).toEqual(new Date("2013-01-02").toISOString()); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='E16']/v").text).toEqual(new Date("2013-01-03").toISOString()); | ||
// Row 17 contains a name and no dates | ||
expect( | ||
buster.expect( | ||
sharedStrings.findall("./si")[ | ||
@@ -388,3 +388,3 @@ parseInt(sheet1.find("./sheetData/row/c[@r='B17']/v").text, 10) | ||
).toEqual("Jim"); | ||
expect(sheet1.find("./sheetData/row/c[@r='C17']")).toBeNull(); | ||
buster.expect(sheet1.find("./sheetData/row/c[@r='C17']")).toBeNull(); | ||
@@ -402,3 +402,3 @@ // XXX: For debugging only | ||
fs.readFile(path.join(__dirname, 'templates', 'test-named-tables.xlsx'), function(err, data) { | ||
expect(err).toBeNull(); | ||
buster.expect(err).toBeNull(); | ||
@@ -431,26 +431,26 @@ var t = new XlsxTemplate(data); | ||
// Named ranges have moved | ||
expect(workbook.find("./definedNames/definedName[@name='BelowTable']").text).toEqual("Tables!$B$18"); | ||
expect(workbook.find("./definedNames/definedName[@name='Moving']").text).toEqual("Tables!$G$8"); | ||
expect(workbook.find("./definedNames/definedName[@name='RangeBelowTable']").text).toEqual("Tables!$B$19:$C$19"); | ||
expect(workbook.find("./definedNames/definedName[@name='RangeRightOfTable']").text).toEqual("Tables!$E$14:$F$14"); | ||
expect(workbook.find("./definedNames/definedName[@name='RightOfTable']").text).toEqual("Tables!$F$8"); | ||
buster.expect(workbook.find("./definedNames/definedName[@name='BelowTable']").text).toEqual("Tables!$B$18"); | ||
buster.expect(workbook.find("./definedNames/definedName[@name='Moving']").text).toEqual("Tables!$G$8"); | ||
buster.expect(workbook.find("./definedNames/definedName[@name='RangeBelowTable']").text).toEqual("Tables!$B$19:$C$19"); | ||
buster.expect(workbook.find("./definedNames/definedName[@name='RangeRightOfTable']").text).toEqual("Tables!$E$14:$F$14"); | ||
buster.expect(workbook.find("./definedNames/definedName[@name='RightOfTable']").text).toEqual("Tables!$F$8"); | ||
// Merged cells have moved | ||
expect(sheet1.find("./mergeCells/mergeCell[@ref='B2:C2']")).not.toBeNull(); // title - unchanged | ||
buster.expect(sheet1.find("./mergeCells/mergeCell[@ref='B2:C2']")).not.toBeNull(); // title - unchanged | ||
expect(sheet1.find("./mergeCells/mergeCell[@ref='B10:C10']")).toBeNull(); // pushed down | ||
expect(sheet1.find("./mergeCells/mergeCell[@ref='B12:C12']")).not.toBeNull(); // pushed down | ||
buster.expect(sheet1.find("./mergeCells/mergeCell[@ref='B10:C10']")).toBeNull(); // pushed down | ||
buster.expect(sheet1.find("./mergeCells/mergeCell[@ref='B12:C12']")).not.toBeNull(); // pushed down | ||
expect(sheet1.find("./mergeCells/mergeCell[@ref='E7:F7']")).toBeNull(); // pushed down and accross | ||
expect(sheet1.find("./mergeCells/mergeCell[@ref='G8:H8']")).not.toBeNull(); // pushed down and accross | ||
buster.expect(sheet1.find("./mergeCells/mergeCell[@ref='E7:F7']")).toBeNull(); // pushed down and accross | ||
buster.expect(sheet1.find("./mergeCells/mergeCell[@ref='G8:H8']")).not.toBeNull(); // pushed down and accross | ||
// Table ranges and autofilter definitions have moved | ||
expect(table1.attrib.ref).toEqual("B4:C6"); // Grown | ||
expect(table1.find("./autoFilter").attrib.ref).toEqual("B4:C6"); // Grown | ||
buster.expect(table1.attrib.ref).toEqual("B4:C6"); // Grown | ||
buster.expect(table1.find("./autoFilter").attrib.ref).toEqual("B4:C6"); // Grown | ||
expect(table2.attrib.ref).toEqual("B8:E10"); // Grown and pushed down | ||
expect(table2.find("./autoFilter").attrib.ref).toEqual("B8:E10"); // Grown and pushed down | ||
buster.expect(table2.attrib.ref).toEqual("B8:E10"); // Grown and pushed down | ||
buster.expect(table2.find("./autoFilter").attrib.ref).toEqual("B8:E10"); // Grown and pushed down | ||
expect(table3.attrib.ref).toEqual("C14:D16"); // Grown and pushed down | ||
expect(table3.find("./autoFilter").attrib.ref).toEqual("C14:D16"); // Grown and pushed down | ||
buster.expect(table3.attrib.ref).toEqual("C14:D16"); // Grown and pushed down | ||
buster.expect(table3.find("./autoFilter").attrib.ref).toEqual("C14:D16"); // Grown and pushed down | ||
@@ -457,0 +457,0 @@ // XXX: For debugging only |
/*jshint globalstrict:true, devel:true */ | ||
/*global require, module, exports, process, __dirname, describe, before, after, it, expect */ | ||
/*global require, module, exports, process, __dirname, describe, before, after, it */ | ||
"use strict"; | ||
@@ -21,6 +21,6 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.stringIndex("foo")).toEqual(0); | ||
expect(t.stringIndex("bar")).toEqual(1); | ||
expect(t.stringIndex("foo")).toEqual(0); | ||
expect(t.stringIndex("baz")).toEqual(2); | ||
buster.expect(t.stringIndex("foo")).toEqual(0); | ||
buster.expect(t.stringIndex("bar")).toEqual(1); | ||
buster.expect(t.stringIndex("foo")).toEqual(0); | ||
buster.expect(t.stringIndex("baz")).toEqual(2); | ||
}); | ||
@@ -35,5 +35,5 @@ | ||
expect(t.replaceString("foo", "bar")).toEqual(0); | ||
expect(t.sharedStrings).toEqual(["bar"]); | ||
expect(t.sharedStringsLookup).toEqual({"bar": 0}); | ||
buster.expect(t.replaceString("foo", "bar")).toEqual(0); | ||
buster.expect(t.sharedStrings).toEqual(["bar"]); | ||
buster.expect(t.sharedStringsLookup).toEqual({"bar": 0}); | ||
}); | ||
@@ -47,5 +47,5 @@ | ||
expect(t.replaceString("foo", "bar")).toEqual(0); | ||
expect(t.sharedStrings).toEqual(["bar", "baz"]); | ||
expect(t.sharedStringsLookup).toEqual({"bar": 0, "baz": 1}); | ||
buster.expect(t.replaceString("foo", "bar")).toEqual(0); | ||
buster.expect(t.sharedStrings).toEqual(["bar", "baz"]); | ||
buster.expect(t.sharedStringsLookup).toEqual({"bar": 0, "baz": 1}); | ||
}); | ||
@@ -60,3 +60,3 @@ | ||
expect(t.extractPlaceholders("${foo}")).toEqual([{ | ||
buster.expect(t.extractPlaceholders("${foo}")).toEqual([{ | ||
full: true, | ||
@@ -73,3 +73,3 @@ key: undefined, | ||
expect(t.extractPlaceholders("A string ${foo} bar")).toEqual([{ | ||
buster.expect(t.extractPlaceholders("A string ${foo} bar")).toEqual([{ | ||
full: false, | ||
@@ -86,3 +86,3 @@ key: undefined, | ||
expect(t.extractPlaceholders("${foo} ${bar}")).toEqual([{ | ||
buster.expect(t.extractPlaceholders("${foo} ${bar}")).toEqual([{ | ||
full: false, | ||
@@ -105,3 +105,3 @@ key: undefined, | ||
expect(t.extractPlaceholders("${foo.bar}")).toEqual([{ | ||
buster.expect(t.extractPlaceholders("${foo.bar}")).toEqual([{ | ||
full: true, | ||
@@ -118,3 +118,3 @@ key: "bar", | ||
expect(t.extractPlaceholders("${table:foo}")).toEqual([{ | ||
buster.expect(t.extractPlaceholders("${table:foo}")).toEqual([{ | ||
full: true, | ||
@@ -131,3 +131,3 @@ key: undefined, | ||
expect(t.extractPlaceholders("${table:foo.bar}")).toEqual([{ | ||
buster.expect(t.extractPlaceholders("${table:foo.bar}")).toEqual([{ | ||
full: true, | ||
@@ -144,3 +144,3 @@ key: "bar", | ||
expect(t.extractPlaceholders("A string")).toEqual([]); | ||
buster.expect(t.extractPlaceholders("A string")).toEqual([]); | ||
}); | ||
@@ -154,5 +154,5 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.isRange("A1:A2")).toEqual(true); | ||
expect(t.isRange("$A$1:$A$2")).toEqual(true); | ||
expect(t.isRange("Table!$A$1:$A$2")).toEqual(true); | ||
buster.expect(t.isRange("A1:A2")).toEqual(true); | ||
buster.expect(t.isRange("$A$1:$A$2")).toEqual(true); | ||
buster.expect(t.isRange("Table!$A$1:$A$2")).toEqual(true); | ||
}); | ||
@@ -162,5 +162,5 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.isRange("A1")).toEqual(false); | ||
expect(t.isRange("$A$1")).toEqual(false); | ||
expect(t.isRange("Table!$A$1")).toEqual(false); | ||
buster.expect(t.isRange("A1")).toEqual(false); | ||
buster.expect(t.isRange("$A$1")).toEqual(false); | ||
buster.expect(t.isRange("Table!$A$1")).toEqual(false); | ||
}); | ||
@@ -174,3 +174,3 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.splitRef("A1")).toEqual({table: null, col: "A", colAbsolute: false, row: 1, rowAbsolute: false}); | ||
buster.expect(t.splitRef("A1")).toEqual({table: null, col: "A", colAbsolute: false, row: 1, rowAbsolute: false}); | ||
}); | ||
@@ -180,3 +180,3 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.splitRef("AB12")).toEqual({table: null, col: "AB", colAbsolute: false, row: 12, rowAbsolute: false}); | ||
buster.expect(t.splitRef("AB12")).toEqual({table: null, col: "AB", colAbsolute: false, row: 12, rowAbsolute: false}); | ||
}); | ||
@@ -186,5 +186,5 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.splitRef("$AB12")).toEqual({table: null, col: "AB", colAbsolute: true, row: 12, rowAbsolute: false}); | ||
expect(t.splitRef("AB$12")).toEqual({table: null, col: "AB", colAbsolute: false, row: 12, rowAbsolute: true}); | ||
expect(t.splitRef("$AB$12")).toEqual({table: null, col: "AB", colAbsolute: true, row: 12, rowAbsolute: true}); | ||
buster.expect(t.splitRef("$AB12")).toEqual({table: null, col: "AB", colAbsolute: true, row: 12, rowAbsolute: false}); | ||
buster.expect(t.splitRef("AB$12")).toEqual({table: null, col: "AB", colAbsolute: false, row: 12, rowAbsolute: true}); | ||
buster.expect(t.splitRef("$AB$12")).toEqual({table: null, col: "AB", colAbsolute: true, row: 12, rowAbsolute: true}); | ||
}); | ||
@@ -194,7 +194,7 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.splitRef("Table one!AB12")).toEqual({table: "Table one", col: "AB", colAbsolute: false, row: 12, rowAbsolute: false}); | ||
expect(t.splitRef("Table one!$AB12")).toEqual({table: "Table one", col: "AB", colAbsolute: true, row: 12, rowAbsolute: false}); | ||
expect(t.splitRef("Table one!$AB12")).toEqual({table: "Table one", col: "AB", colAbsolute: true, row: 12, rowAbsolute: false}); | ||
expect(t.splitRef("Table one!AB$12")).toEqual({table: "Table one", col: "AB", colAbsolute: false, row: 12, rowAbsolute: true}); | ||
expect(t.splitRef("Table one!$AB$12")).toEqual({table: "Table one", col: "AB", colAbsolute: true, row: 12, rowAbsolute: true}); | ||
buster.expect(t.splitRef("Table one!AB12")).toEqual({table: "Table one", col: "AB", colAbsolute: false, row: 12, rowAbsolute: false}); | ||
buster.expect(t.splitRef("Table one!$AB12")).toEqual({table: "Table one", col: "AB", colAbsolute: true, row: 12, rowAbsolute: false}); | ||
buster.expect(t.splitRef("Table one!$AB12")).toEqual({table: "Table one", col: "AB", colAbsolute: true, row: 12, rowAbsolute: false}); | ||
buster.expect(t.splitRef("Table one!AB$12")).toEqual({table: "Table one", col: "AB", colAbsolute: false, row: 12, rowAbsolute: true}); | ||
buster.expect(t.splitRef("Table one!$AB$12")).toEqual({table: "Table one", col: "AB", colAbsolute: true, row: 12, rowAbsolute: true}); | ||
}); | ||
@@ -208,3 +208,3 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.splitRange("A1:B1")).toEqual({start: "A1", end: "B1"}); | ||
buster.expect(t.splitRange("A1:B1")).toEqual({start: "A1", end: "B1"}); | ||
}); | ||
@@ -214,3 +214,3 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.splitRange("AB12:CC13")).toEqual({start: "AB12", end: "CC13"}); | ||
buster.expect(t.splitRange("AB12:CC13")).toEqual({start: "AB12", end: "CC13"}); | ||
}); | ||
@@ -224,3 +224,3 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.joinRange({start: "A1", end: "B1"})).toEqual("A1:B1"); | ||
buster.expect(t.joinRange({start: "A1", end: "B1"})).toEqual("A1:B1"); | ||
}); | ||
@@ -230,3 +230,3 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.joinRange({start: "AB12", end: "CC13"})).toEqual("AB12:CC13"); | ||
buster.expect(t.joinRange({start: "AB12", end: "CC13"})).toEqual("AB12:CC13"); | ||
}); | ||
@@ -240,3 +240,3 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.joinRef({col: "A", row: 1})).toEqual("A1"); | ||
buster.expect(t.joinRef({col: "A", row: 1})).toEqual("A1"); | ||
}); | ||
@@ -246,3 +246,3 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.joinRef({col: "AB", row: 12})).toEqual("AB12"); | ||
buster.expect(t.joinRef({col: "AB", row: 12})).toEqual("AB12"); | ||
}); | ||
@@ -252,5 +252,5 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.joinRef({col: "AB", colAbsolute: true, row: 12, rowAbsolute: false})).toEqual("$AB12"); | ||
expect(t.joinRef({col: "AB", colAbsolute: true, row: 12, rowAbsolute: true})).toEqual("$AB$12"); | ||
expect(t.joinRef({col: "AB", colAbsolute: false, row: 12, rowAbsolute: false})).toEqual("AB12"); | ||
buster.expect(t.joinRef({col: "AB", colAbsolute: true, row: 12, rowAbsolute: false})).toEqual("$AB12"); | ||
buster.expect(t.joinRef({col: "AB", colAbsolute: true, row: 12, rowAbsolute: true})).toEqual("$AB$12"); | ||
buster.expect(t.joinRef({col: "AB", colAbsolute: false, row: 12, rowAbsolute: false})).toEqual("AB12"); | ||
}); | ||
@@ -260,5 +260,5 @@ | ||
var t = new XlsxTemplate(); | ||
expect(t.joinRef({table: "Table one", col: "AB", colAbsolute: true, row: 12, rowAbsolute: false})).toEqual("Table one!$AB12"); | ||
expect(t.joinRef({table: "Table one", col: "AB", colAbsolute: true, row: 12, rowAbsolute: true})).toEqual("Table one!$AB$12"); | ||
expect(t.joinRef({table: "Table one", col: "AB", colAbsolute: false, row: 12, rowAbsolute: false})).toEqual("Table one!AB12"); | ||
buster.expect(t.joinRef({table: "Table one", col: "AB", colAbsolute: true, row: 12, rowAbsolute: false})).toEqual("Table one!$AB12"); | ||
buster.expect(t.joinRef({table: "Table one", col: "AB", colAbsolute: true, row: 12, rowAbsolute: true})).toEqual("Table one!$AB$12"); | ||
buster.expect(t.joinRef({table: "Table one", col: "AB", colAbsolute: false, row: 12, rowAbsolute: false})).toEqual("Table one!AB12"); | ||
}); | ||
@@ -273,4 +273,4 @@ | ||
expect(t.nextCol("A1")).toEqual("B1"); | ||
expect(t.nextCol("B1")).toEqual("C1"); | ||
buster.expect(t.nextCol("A1")).toEqual("B1"); | ||
buster.expect(t.nextCol("B1")).toEqual("C1"); | ||
}); | ||
@@ -281,4 +281,4 @@ | ||
expect(t.nextCol("A99")).toEqual("B99"); | ||
expect(t.nextCol("B11231")).toEqual("C11231"); | ||
buster.expect(t.nextCol("A99")).toEqual("B99"); | ||
buster.expect(t.nextCol("B11231")).toEqual("C11231"); | ||
}); | ||
@@ -289,4 +289,4 @@ | ||
expect(t.nextCol("a1")).toEqual("B1"); | ||
expect(t.nextCol("b1")).toEqual("C1"); | ||
buster.expect(t.nextCol("a1")).toEqual("B1"); | ||
buster.expect(t.nextCol("b1")).toEqual("C1"); | ||
}); | ||
@@ -297,3 +297,3 @@ | ||
expect(t.nextCol("AA12")).toEqual("AB12"); | ||
buster.expect(t.nextCol("AA12")).toEqual("AB12"); | ||
}); | ||
@@ -304,3 +304,3 @@ | ||
expect(t.nextCol("AZ12")).toEqual("BA12"); | ||
buster.expect(t.nextCol("AZ12")).toEqual("BA12"); | ||
}); | ||
@@ -311,4 +311,4 @@ | ||
expect(t.nextCol("Z12")).toEqual("AA12"); | ||
expect(t.nextCol("ZZ12")).toEqual("AAA12"); | ||
buster.expect(t.nextCol("Z12")).toEqual("AA12"); | ||
buster.expect(t.nextCol("ZZ12")).toEqual("AAA12"); | ||
}); | ||
@@ -323,5 +323,5 @@ | ||
expect(t.nextRow("A1")).toEqual("A2"); | ||
expect(t.nextRow("B1")).toEqual("B2"); | ||
expect(t.nextRow("AZ2")).toEqual("AZ3"); | ||
buster.expect(t.nextRow("A1")).toEqual("A2"); | ||
buster.expect(t.nextRow("B1")).toEqual("B2"); | ||
buster.expect(t.nextRow("AZ2")).toEqual("AZ3"); | ||
}); | ||
@@ -332,4 +332,4 @@ | ||
expect(t.nextRow("a1")).toEqual("A2"); | ||
expect(t.nextRow("b1")).toEqual("B2"); | ||
buster.expect(t.nextRow("a1")).toEqual("A2"); | ||
buster.expect(t.nextRow("b1")).toEqual("B2"); | ||
}); | ||
@@ -340,5 +340,5 @@ | ||
expect(t.nextRow("A12")).toEqual("A13"); | ||
expect(t.nextRow("AZ12")).toEqual("AZ13"); | ||
expect(t.nextRow("A123")).toEqual("A124"); | ||
buster.expect(t.nextRow("A12")).toEqual("A13"); | ||
buster.expect(t.nextRow("AZ12")).toEqual("AZ13"); | ||
buster.expect(t.nextRow("A123")).toEqual("A124"); | ||
}); | ||
@@ -353,5 +353,5 @@ | ||
expect(t.charToNum("A")).toEqual(1); | ||
expect(t.charToNum("B")).toEqual(2); | ||
expect(t.charToNum("Z")).toEqual(26); | ||
buster.expect(t.charToNum("A")).toEqual(1); | ||
buster.expect(t.charToNum("B")).toEqual(2); | ||
buster.expect(t.charToNum("Z")).toEqual(26); | ||
}); | ||
@@ -362,5 +362,5 @@ | ||
expect(t.charToNum("AA")).toEqual(27); | ||
expect(t.charToNum("AZ")).toEqual(52); | ||
expect(t.charToNum("BZ")).toEqual(78); | ||
buster.expect(t.charToNum("AA")).toEqual(27); | ||
buster.expect(t.charToNum("AZ")).toEqual(52); | ||
buster.expect(t.charToNum("BZ")).toEqual(78); | ||
}); | ||
@@ -371,5 +371,5 @@ | ||
expect(t.charToNum("AAA")).toEqual(703); | ||
expect(t.charToNum("AAZ")).toEqual(728); | ||
expect(t.charToNum("ADI")).toEqual(789); | ||
buster.expect(t.charToNum("AAA")).toEqual(703); | ||
buster.expect(t.charToNum("AAZ")).toEqual(728); | ||
buster.expect(t.charToNum("ADI")).toEqual(789); | ||
}); | ||
@@ -384,5 +384,5 @@ | ||
expect(t.numToChar(1)).toEqual("A"); | ||
expect(t.numToChar(2)).toEqual("B"); | ||
expect(t.numToChar(26)).toEqual("Z"); | ||
buster.expect(t.numToChar(1)).toEqual("A"); | ||
buster.expect(t.numToChar(2)).toEqual("B"); | ||
buster.expect(t.numToChar(26)).toEqual("Z"); | ||
}); | ||
@@ -393,5 +393,5 @@ | ||
expect(t.numToChar(27)).toEqual("AA"); | ||
expect(t.numToChar(52)).toEqual("AZ"); | ||
expect(t.numToChar(78)).toEqual("BZ"); | ||
buster.expect(t.numToChar(27)).toEqual("AA"); | ||
buster.expect(t.numToChar(52)).toEqual("AZ"); | ||
buster.expect(t.numToChar(78)).toEqual("BZ"); | ||
}); | ||
@@ -402,5 +402,5 @@ | ||
expect(t.numToChar(703)).toEqual("AAA"); | ||
expect(t.numToChar(728)).toEqual("AAZ"); | ||
expect(t.numToChar(789)).toEqual("ADI"); | ||
buster.expect(t.numToChar(703)).toEqual("AAA"); | ||
buster.expect(t.numToChar(728)).toEqual("AAZ"); | ||
buster.expect(t.numToChar(789)).toEqual("ADI"); | ||
}); | ||
@@ -415,5 +415,5 @@ | ||
expect(t.isWithin("A1", "A1", "A1")).toEqual(true); | ||
expect(t.isWithin("A2", "A1", "A1")).toEqual(false); | ||
expect(t.isWithin("B1", "A1", "A1")).toEqual(false); | ||
buster.expect(t.isWithin("A1", "A1", "A1")).toEqual(true); | ||
buster.expect(t.isWithin("A2", "A1", "A1")).toEqual(false); | ||
buster.expect(t.isWithin("B1", "A1", "A1")).toEqual(false); | ||
}); | ||
@@ -424,7 +424,7 @@ | ||
expect(t.isWithin("A1", "A1", "A3")).toEqual(true); | ||
expect(t.isWithin("A3", "A1", "A3")).toEqual(true); | ||
expect(t.isWithin("A4", "A1", "A3")).toEqual(false); | ||
expect(t.isWithin("A5", "A1", "A3")).toEqual(false); | ||
expect(t.isWithin("B1", "A1", "A3")).toEqual(false); | ||
buster.expect(t.isWithin("A1", "A1", "A3")).toEqual(true); | ||
buster.expect(t.isWithin("A3", "A1", "A3")).toEqual(true); | ||
buster.expect(t.isWithin("A4", "A1", "A3")).toEqual(false); | ||
buster.expect(t.isWithin("A5", "A1", "A3")).toEqual(false); | ||
buster.expect(t.isWithin("B1", "A1", "A3")).toEqual(false); | ||
}); | ||
@@ -435,7 +435,7 @@ | ||
expect(t.isWithin("A1", "A2", "C3")).toEqual(false); | ||
expect(t.isWithin("A3", "A2", "C3")).toEqual(true); | ||
expect(t.isWithin("B2", "A2", "C3")).toEqual(true); | ||
expect(t.isWithin("A5", "A2", "C3")).toEqual(false); | ||
expect(t.isWithin("D2", "A2", "C3")).toEqual(false); | ||
buster.expect(t.isWithin("A1", "A2", "C3")).toEqual(false); | ||
buster.expect(t.isWithin("A3", "A2", "C3")).toEqual(true); | ||
buster.expect(t.isWithin("B2", "A2", "C3")).toEqual(true); | ||
buster.expect(t.isWithin("A5", "A2", "C3")).toEqual(false); | ||
buster.expect(t.isWithin("D2", "A2", "C3")).toEqual(false); | ||
}); | ||
@@ -446,7 +446,7 @@ | ||
expect(t.isWithin("AZ1", "AZ2", "CZ3")).toEqual(false); | ||
expect(t.isWithin("AZ3", "AZ2", "CZ3")).toEqual(true); | ||
expect(t.isWithin("BZ2", "AZ2", "CZ3")).toEqual(true); | ||
expect(t.isWithin("AZ5", "AZ2", "CZ3")).toEqual(false); | ||
expect(t.isWithin("DZ2", "AZ2", "CZ3")).toEqual(false); | ||
buster.expect(t.isWithin("AZ1", "AZ2", "CZ3")).toEqual(false); | ||
buster.expect(t.isWithin("AZ3", "AZ2", "CZ3")).toEqual(true); | ||
buster.expect(t.isWithin("BZ2", "AZ2", "CZ3")).toEqual(true); | ||
buster.expect(t.isWithin("AZ5", "AZ2", "CZ3")).toEqual(false); | ||
buster.expect(t.isWithin("DZ2", "AZ2", "CZ3")).toEqual(false); | ||
}); | ||
@@ -461,3 +461,3 @@ | ||
expect(t.stringify(new Date("2013-01-01"))).toEqual("2013-01-01T00:00:00.000Z"); | ||
buster.expect(t.stringify(new Date("2013-01-01"))).toEqual("2013-01-01T00:00:00.000Z"); | ||
}); | ||
@@ -468,4 +468,4 @@ | ||
expect(t.stringify(12)).toEqual("12"); | ||
expect(t.stringify(12.3)).toEqual("12.3"); | ||
buster.expect(t.stringify(12)).toEqual("12"); | ||
buster.expect(t.stringify(12.3)).toEqual("12.3"); | ||
}); | ||
@@ -476,4 +476,4 @@ | ||
expect(t.stringify(true)).toEqual("1"); | ||
expect(t.stringify(false)).toEqual("0"); | ||
buster.expect(t.stringify(true)).toEqual("1"); | ||
buster.expect(t.stringify(false)).toEqual("0"); | ||
}); | ||
@@ -484,3 +484,3 @@ | ||
expect(t.stringify("foo")).toEqual("foo"); | ||
buster.expect(t.stringify("foo")).toEqual("foo"); | ||
}); | ||
@@ -514,6 +514,6 @@ | ||
t.addSharedString(string); | ||
expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("bar"); | ||
expect(col.attrib.t).toEqual("s"); | ||
expect(val.text).toEqual("0"); | ||
expect(t.sharedStrings).toEqual(["bar"]); | ||
buster.expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("bar"); | ||
buster.expect(col.attrib.t).toEqual("s"); | ||
buster.expect(String(val.text)).toEqual("0"); | ||
buster.expect(t.sharedStrings).toEqual(["bar"]); | ||
}); | ||
@@ -543,6 +543,6 @@ | ||
t.addSharedString(string); | ||
expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("10"); | ||
expect(col.attrib.t).toEqual("n"); | ||
expect(val.text).toEqual("10"); | ||
expect(t.sharedStrings).toEqual(["${foo}"]); | ||
buster.expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("10"); | ||
buster.expect(col.attrib.t).toEqual("n"); | ||
buster.expect(val.text).toEqual("10"); | ||
buster.expect(t.sharedStrings).toEqual(["${foo}"]); | ||
}); | ||
@@ -572,6 +572,6 @@ | ||
t.addSharedString(string); | ||
expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("0"); | ||
expect(col.attrib.t).toEqual("b"); | ||
expect(val.text).toEqual("0"); | ||
expect(t.sharedStrings).toEqual(["${foo}"]); | ||
buster.expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("0"); | ||
buster.expect(col.attrib.t).toEqual("b"); | ||
buster.expect(val.text).toEqual("0"); | ||
buster.expect(t.sharedStrings).toEqual(["${foo}"]); | ||
}); | ||
@@ -601,6 +601,6 @@ | ||
t.addSharedString(string); | ||
expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("1"); | ||
expect(col.attrib.t).toEqual("b"); | ||
expect(val.text).toEqual("1"); | ||
expect(t.sharedStrings).toEqual(["${foo}"]); | ||
buster.expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("1"); | ||
buster.expect(col.attrib.t).toEqual("b"); | ||
buster.expect(val.text).toEqual("1"); | ||
buster.expect(t.sharedStrings).toEqual(["${foo}"]); | ||
}); | ||
@@ -630,6 +630,6 @@ | ||
t.addSharedString(string); | ||
expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("2013-01-01T00:00:00.000Z"); | ||
expect(col.attrib.t).toEqual("d"); | ||
expect(val.text).toEqual("2013-01-01T00:00:00.000Z"); | ||
expect(t.sharedStrings).toEqual(["${foo}"]); | ||
buster.expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("2013-01-01T00:00:00.000Z"); | ||
buster.expect(col.attrib.t).toEqual("d"); | ||
buster.expect(val.text).toEqual("2013-01-01T00:00:00.000Z"); | ||
buster.expect(t.sharedStrings).toEqual(["${foo}"]); | ||
}); | ||
@@ -659,6 +659,6 @@ | ||
t.addSharedString(string); | ||
expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("foo: bar"); | ||
expect(col.attrib.t).toEqual("s"); | ||
expect(val.text).toEqual("0"); | ||
expect(t.sharedStrings).toEqual(["foo: bar"]); | ||
buster.expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("foo: bar"); | ||
buster.expect(col.attrib.t).toEqual("s"); | ||
buster.expect(val.text).toEqual("0"); | ||
buster.expect(t.sharedStrings).toEqual(["foo: bar"]); | ||
}); | ||
@@ -688,6 +688,6 @@ | ||
t.addSharedString(string); | ||
expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("foo: 0"); | ||
expect(col.attrib.t).toEqual("s"); | ||
expect(val.text).toEqual("0"); | ||
expect(t.sharedStrings).toEqual(["foo: 0"]); | ||
buster.expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("foo: 0"); | ||
buster.expect(col.attrib.t).toEqual("s"); | ||
buster.expect(val.text).toEqual("0"); | ||
buster.expect(t.sharedStrings).toEqual(["foo: 0"]); | ||
}); | ||
@@ -717,6 +717,6 @@ | ||
t.addSharedString(string); | ||
expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("foo: 10"); | ||
expect(col.attrib.t).toEqual("s"); | ||
expect(val.text).toEqual("0"); | ||
expect(t.sharedStrings).toEqual(["foo: 10"]); | ||
buster.expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("foo: 10"); | ||
buster.expect(col.attrib.t).toEqual("s"); | ||
buster.expect(val.text).toEqual("0"); | ||
buster.expect(t.sharedStrings).toEqual(["foo: 10"]); | ||
}); | ||
@@ -723,0 +723,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
241480
150