Skip to content

Commit d45669b

Browse files
authored
add: unicode test cases for cross-sheet names (#2047)
1 parent 5c94936 commit d45669b

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,6 +2319,20 @@ describe('corner cases', function() {
23192319
X.read(fs.readFileSync(dir + 'wtf_path.xlsx'), {WTF:1, type:TYPE});
23202320
X.read(fs.readFileSync(dir + 'wtf_path.xlsb'), {WTF:1, type:TYPE});
23212321
});
2322+
it("should quote unicode sheet names in formulae", function() {
2323+
var wb = X.read(fs.readFileSync(dir + "cross-sheet_formula_names.xlsb"), {WTF:1, type:TYPE});
2324+
assert.equal(wb.Sheets["Sheet1"]["A1"].f, "'a-b'!A1");
2325+
assert.equal(wb.Sheets["Sheet1"]["A2"].f, "'a#b'!A1");
2326+
assert.equal(wb.Sheets["Sheet1"]["A3"].f, "'a^b'!A1");
2327+
assert.equal(wb.Sheets["Sheet1"]["A4"].f, "'a%b'!A1");
2328+
assert.equal(wb.Sheets["Sheet1"]["A5"].f, "'a\u066ab'!A1");
2329+
assert.equal(wb.Sheets["Sheet1"]["A6"].f, "'☃️'!A1");
2330+
assert.equal(wb.Sheets["Sheet1"]["A7"].f, "'\ud83c\udf63'!A1");
2331+
assert.equal(wb.Sheets["Sheet1"]["A8"].f, "'a!!b'!A1");
2332+
assert.equal(wb.Sheets["Sheet1"]["A9"].f, "'a$b'!A1");
2333+
assert.equal(wb.Sheets["Sheet1"]["A10"].f, "'a!b'!A1");
2334+
assert.equal(wb.Sheets["Sheet1"]["A11"].f, "'a b'!A1");
2335+
});
23222336
});
23232337

23242338
describe('encryption', function() {

tests/core.js

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/fixtures.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/fixtures.lst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
./test_files/column_width.xlsx
5757
./test_files/column_width.xlsb
5858
./test_files/column_width.slk
59+
./test_files/cross-sheet_formula_names.xlsb
5960
./test_files/defined_names_simple.xls
6061
./test_files/defined_names_simple.xml
6162
./test_files/defined_names_simple.xlsx

0 commit comments

Comments
 (0)