mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
parent
22612d9a62
commit
d72da755f0
24 changed files with 930 additions and 21 deletions
21
test/functional/src/test_dynamic_array02.c
Normal file
21
test/functional/src/test_dynamic_array02.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/*****************************************************************************
|
||||
* Test cases for libxlsxwriter.
|
||||
*
|
||||
* Test to compare output against Excel files.
|
||||
*
|
||||
* Copyright 2014-2021, John McNamara, jmcnamara@cpan.org
|
||||
*
|
||||
*/
|
||||
|
||||
#include "xlsxwriter.h"
|
||||
|
||||
int main() {
|
||||
|
||||
lxw_workbook *workbook = workbook_new("test_dynamic_array02.xlsx");
|
||||
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
|
||||
|
||||
worksheet_write_dynamic_formula(worksheet, CELL("B1"), "=_xlfn.UNIQUE(A1)", NULL);
|
||||
worksheet_write_number(worksheet, CELL("A1"), 0 , NULL);
|
||||
|
||||
return workbook_close(workbook);
|
||||
}
|
||||
20
test/functional/src/test_dynamic_array03.c
Normal file
20
test/functional/src/test_dynamic_array03.c
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*****************************************************************************
|
||||
* Test cases for libxlsxwriter.
|
||||
*
|
||||
* Test to compare output against Excel files.
|
||||
*
|
||||
* Copyright 2014-2021, John McNamara, jmcnamara@cpan.org
|
||||
*
|
||||
*/
|
||||
|
||||
#include "xlsxwriter.h"
|
||||
|
||||
int main() {
|
||||
|
||||
lxw_workbook *workbook = workbook_new("test_dynamic_array03.xlsx");
|
||||
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
|
||||
|
||||
worksheet_write_formula_num(worksheet, CELL("A1"), "=1+_xlfn.XOR(1)", NULL, 2);
|
||||
|
||||
return workbook_close(workbook);
|
||||
}
|
||||
22
test/functional/src/test_dynamic_array51.c
Normal file
22
test/functional/src/test_dynamic_array51.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/*****************************************************************************
|
||||
* Test cases for libxlsxwriter.
|
||||
*
|
||||
* Test to compare output against Excel files.
|
||||
*
|
||||
* Copyright 2014-2021, John McNamara, jmcnamara@cpan.org
|
||||
*
|
||||
*/
|
||||
|
||||
#include "xlsxwriter.h"
|
||||
|
||||
int main() {
|
||||
|
||||
lxw_workbook *workbook = workbook_new("test_dynamic_array51.xlsx");
|
||||
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
|
||||
|
||||
worksheet_write_dynamic_array_formula_num(worksheet, RANGE("A1:A1"), "=AVERAGE(TIMEVALUE(B1:B2))", NULL, 0);
|
||||
worksheet_write_string(worksheet, CELL("B1"), "12:00" , NULL);
|
||||
worksheet_write_string(worksheet, CELL("B2"), "12:00" , NULL);
|
||||
|
||||
return workbook_close(workbook);
|
||||
}
|
||||
22
test/functional/src/test_dynamic_array52.c
Normal file
22
test/functional/src/test_dynamic_array52.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/*****************************************************************************
|
||||
* Test cases for libxlsxwriter.
|
||||
*
|
||||
* Test to compare output against Excel files.
|
||||
*
|
||||
* Copyright 2014-2021, John McNamara, jmcnamara@cpan.org
|
||||
*
|
||||
*/
|
||||
|
||||
#include "xlsxwriter.h"
|
||||
|
||||
int main() {
|
||||
|
||||
lxw_workbook *workbook = workbook_new("test_dynamic_array52.xlsx");
|
||||
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
|
||||
|
||||
worksheet_write_dynamic_formula(worksheet, CELL("A1"), "=AVERAGE(TIMEVALUE(B1:B2))", NULL);
|
||||
worksheet_write_string(worksheet, CELL("B1"), "12:00" , NULL);
|
||||
worksheet_write_string(worksheet, CELL("B2"), "12:00" , NULL);
|
||||
|
||||
return workbook_close(workbook);
|
||||
}
|
||||
22
test/functional/src/test_dynamic_array53.c
Normal file
22
test/functional/src/test_dynamic_array53.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/*****************************************************************************
|
||||
* Test cases for libxlsxwriter.
|
||||
*
|
||||
* Test to compare output against Excel files.
|
||||
*
|
||||
* Copyright 2014-2021, John McNamara, jmcnamara@cpan.org
|
||||
*
|
||||
*/
|
||||
|
||||
#include "xlsxwriter.h"
|
||||
|
||||
int main() {
|
||||
|
||||
lxw_workbook *workbook = workbook_new("test_dynamic_array53.xlsx");
|
||||
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
|
||||
|
||||
worksheet_write_dynamic_formula_num(worksheet, CELL("A1"), "=AVERAGE(TIMEVALUE(B1:B2))", NULL, 0);
|
||||
worksheet_write_string(worksheet, CELL("B1"), "12:00" , NULL);
|
||||
worksheet_write_string(worksheet, CELL("B2"), "12:00" , NULL);
|
||||
|
||||
return workbook_close(workbook);
|
||||
}
|
||||
|
|
@ -15,3 +15,19 @@ class TestCompareXLSXFiles(base_test_class.XLSXBaseTest):
|
|||
|
||||
def test_dynamic_array01(self):
|
||||
self.run_exe_test('test_dynamic_array01')
|
||||
|
||||
def test_dynamic_array02(self):
|
||||
self.run_exe_test('test_dynamic_array02')
|
||||
|
||||
def test_dynamic_array03(self):
|
||||
self.run_exe_test('test_dynamic_array03')
|
||||
|
||||
# Some variant of the default test case.
|
||||
def test_dynamic_array51(self):
|
||||
self.run_exe_test('test_dynamic_array51', 'dynamic_array01.xlsx')
|
||||
|
||||
def test_dynamic_array52(self):
|
||||
self.run_exe_test('test_dynamic_array52', 'dynamic_array01.xlsx')
|
||||
|
||||
def test_dynamic_array53(self):
|
||||
self.run_exe_test('test_dynamic_array53', 'dynamic_array01.xlsx')
|
||||
|
|
|
|||
BIN
test/functional/xlsx_files/dynamic_array02.xlsx
Normal file
BIN
test/functional/xlsx_files/dynamic_array02.xlsx
Normal file
Binary file not shown.
BIN
test/functional/xlsx_files/dynamic_array03.xlsx
Normal file
BIN
test/functional/xlsx_files/dynamic_array03.xlsx
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue