From 0897cc9fcbc181466d670735e07fe7b072edeaa6 Mon Sep 17 00:00:00 2001 From: Kostas Dizas <254960+kostasdizas@users.noreply.github.com> Date: Wed, 21 Nov 2018 12:59:17 +0000 Subject: [PATCH] Roundtrip test of the phonetics feature --- tests/data/15_phonetics.xlsx | Bin 0 -> 10122 bytes tests/worksheet/worksheet_test_suite.cpp | 24 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/data/15_phonetics.xlsx diff --git a/tests/data/15_phonetics.xlsx b/tests/data/15_phonetics.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..2af2e5b3b59311432c3f548f7629eec76393e4aa GIT binary patch literal 10122 zcmeHtg;yQP_BAfSo#5^l4-y~**Wm8%?oMzIZb5>(yIlzG!QCxraM$0>%$sj!GV}cf z@AX})d)=uCIS(dh8BvE_&T2E}-NTQSD?NPLMY8fhxq(5@vxaZfk{KOiB!f$4&9I)| zpD8TM%}M9)Q#df##PwD7harKNO~C~0Hk8Qi3+6T2e#^yILDa#oq!ivEKh_8Kc|4EC zcQgZz&yx0iS)XCRz+PS;!Q}qtmi5ZaNrSu&0pymt4#rlFOpHIz|8vLxVjuj= zrmnYS&2avlyVgiZzWao`6#iBQXiE|fxps0O@OL|7XT^d3-oy$ zT3X?aIv60m-efO}K*!`EZ*VOSPQJHyhNYu&ND{R#+vq`anYo&|P8E}Mr*Q#B)0H+A zWlIgNk&8~930I?zF{gYJC{_j zkHjC!EqyeZiZ$S9V7gG@HDE=0b%&>{XvS?`WsvFcmdst($m;8ba9Rh(lNUfHeL#VX z9sQPdOst&jQ7j{R&n!@Y+SzPohbbkIM7xM&p=q5kP4e(w^JFF+&G0&)^OFgS2G zE2iK5#MRcp(!kc%@@Mq=!)L%jAq-^Yzxyat_#oB8j0!|}4qa2zKb z0&!-zZu{eXpyE-ve_dlE$!A)VotI{zrE8ck{_eyR7q8(Zc#+(}CibRD>2EtluHnwx z9!);Df3xh&y+_<3D3u~AdBf)w>_ieWAV%y<8|S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)WPqdyvOY7Px` z%L(_^x_scD9^P|lNU8No$y2re+}G_Ct7ST9?Ba9Qz_i3UkoJWPRb_V08hSwtsGHym z`EP!E%~2!u1w>DAP%G+R>8WpL_dj-mX!)NbJ^q93(oZoK@|qZN1)qCG4$&{iK#KFS zN)J5F#Z;!iFuTDhv@G^$F1kT}Zr^3`#}2FxUmk^{r^P{8xA42*dJRU0M18yJ(~Tw- zln`6hFG`|_*&pA+XqB?XwbY-irD}%*sIJ9R)u1#=!<)6uKU8$Vn33*~B(fI3sC79_ zS2F;+TlX^Y5z8ts9!0mpSTNPJ>f^KV2vrGRD$UWf$HbyT9O=K#df6;3^5~^b+5n|u z4F(sm(@_YDhuSj9#kW2jG^ zl?e5-7;pOyLsTkXBfxo9)gO?!!!dmHUcyCeu?dTRdOd}q94aj;)ty4H-R4^HB-ToR zC#=PB4MQG^$%uxMX_-g7gN*(X;Kof&ge$s=X3A^xi9?z`q^){I@FO`Dt+WM38g`eu zLj3)4HwIr_h#PDq(=br_vo|z6LUXkFonqJWu#O^tO4n%cDKGg9bF#qSu4l7%^F;8) zgs4ASKbbS)QHU{GFNy8`3Ss_F1qB=e017<+zU%3aN&MsbFMFWmr2cN;@B1_U0RFrt zgFNLgyET3V{#~>FE3geDN&f#8>|gEtDrEj?=>((={UU4r3jS3>`V(A(@EiC~LFrfM zuLYPtp_QPx4tnmd<(OX${F*}kX@HU7|GoG>63Sn#{F+bvX~mT2_b>Q0yZF_@-vjTT vcrdV!ph*3XF#Ie0?+fE!;lyNrf&XWjl#_x6%`O<&E70#FDAHe2{QUQSQ&qMy literal 0 HcmV?d00001 diff --git a/tests/worksheet/worksheet_test_suite.cpp b/tests/worksheet/worksheet_test_suite.cpp index f324eb4e..24dad90c 100644 --- a/tests/worksheet/worksheet_test_suite.cpp +++ b/tests/worksheet/worksheet_test_suite.cpp @@ -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().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().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; \ No newline at end of file