mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
Roundtrip test of the phonetics feature
This commit is contained in:
parent
38f12ff846
commit
0897cc9fcb
BIN
tests/data/15_phonetics.xlsx
Normal file
BIN
tests/data/15_phonetics.xlsx
Normal file
Binary file not shown.
|
@ -104,6 +104,7 @@ public:
|
|||
register_test(test_clear_cell);
|
||||
register_test(test_clear_row);
|
||||
register_test(test_set_title);
|
||||
register_test(test_phonetics);
|
||||
}
|
||||
|
||||
void test_new_worksheet()
|
||||
|
@ -1259,5 +1260,28 @@ public:
|
|||
xlnt_assert(ws1_title == ws1.title());
|
||||
xlnt_assert(ws2_title == ws2.title());
|
||||
}
|
||||
|
||||
void test_phonetics()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
wb.load(path_helper::test_file("15_phonetics.xlsx"));
|
||||
auto ws = wb.active_sheet();
|
||||
|
||||
xlnt_assert_equals(ws.cell("A1").phonetics_visible(), true);
|
||||
xlnt_assert_equals(ws.cell("A1").value<xlnt::rich_text>().phonetic_runs()[0].text, "シュウ ");
|
||||
xlnt_assert_equals(ws.cell("B1").phonetics_visible(), true);
|
||||
xlnt_assert_equals(ws.cell("C1").phonetics_visible(), false);
|
||||
|
||||
wb.save("temp.xlsx");
|
||||
|
||||
xlnt::workbook wb2;
|
||||
wb2.load("temp.xlsx");
|
||||
auto ws2 = wb2.active_sheet();
|
||||
|
||||
xlnt_assert_equals(ws2.cell("A1").phonetics_visible(), true);
|
||||
xlnt_assert_equals(ws2.cell("A1").value<xlnt::rich_text>().phonetic_runs()[0].text, "シュウ ");
|
||||
xlnt_assert_equals(ws2.cell("B1").phonetics_visible(), true);
|
||||
xlnt_assert_equals(ws2.cell("C1").phonetics_visible(), false);
|
||||
}
|
||||
};
|
||||
static worksheet_test_suite x;
|
Loading…
Reference in New Issue
Block a user