Roundtrip test of the phonetics feature

This commit is contained in:
Kostas Dizas 2018-11-21 12:59:17 +00:00
parent 38f12ff846
commit 0897cc9fcb
No known key found for this signature in database
GPG Key ID: 8D3074191407AC9E
2 changed files with 24 additions and 0 deletions

Binary file not shown.

View File

@ -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;