@@ -1181,14 +1181,37 @@ fn issue_72() {
11811181}
11821182
11831183#[ test]
1184- fn issue_128 ( ) {
1185- let xlsx_path = std:: path:: Path :: new ( "./tests/test_files/wb_with_shared_strings.xlsx" ) ;
1184+ fn issue_129 ( ) {
1185+ let path = std:: path:: Path :: new ( "./tests/test_files/aaa.xlsx" ) ;
1186+ let book = umya_spreadsheet:: reader:: xlsx:: read ( path) . unwrap ( ) ;
1187+ let img = book
1188+ . get_sheet_by_name ( "Sheet1" )
1189+ . unwrap ( )
1190+ . get_image ( "M17" )
1191+ . unwrap ( ) ;
1192+ //dbg!(img.get_one_cell_anchor().is_some());
1193+ //dbg!(img.get_two_cell_anchor().is_some());
1194+ assert_eq ! ( img. get_image_name( ) , "image1.png" ) ;
1195+ assert_eq ! ( img. get_coordinate( ) , "M17" ) ;
1196+ assert_eq ! ( img. get_col( ) , & 12 ) ;
1197+ assert_eq ! ( img. get_row( ) , & 16 ) ;
1198+
1199+ let path = std:: path:: Path :: new ( "./tests/result_files/issue_129.xlsx" ) ;
1200+ let _ = umya_spreadsheet:: writer:: xlsx:: write ( & book, path) ;
1201+ }
11861202
1187- let book = umya_spreadsheet:: reader:: xlsx:: read ( xlsx_path) . unwrap ( ) ;
1203+ #[ test]
1204+ fn wb_with_shared_strings ( ) {
1205+ let path = std:: path:: Path :: new ( "./tests/test_files/wb_with_shared_strings.xlsx" ) ;
1206+ let book = umya_spreadsheet:: reader:: xlsx:: read ( path) . unwrap ( ) ;
11881207 let sheet = book. get_sheet_by_name ( "Sheet To Read From" ) . unwrap ( ) ;
1189- assert_eq ! ( sheet. get_formatted_value( "A2" ) , "11" ) ;
1190- assert_eq ! ( sheet. get_formatted_value( "A3" ) , "22" ) ;
1191- assert_eq ! ( sheet. get_formatted_value( "A4" ) , "ABCdef" ) ;
1192- assert_eq ! ( sheet. get_formatted_value( "A5" ) , "ABCdef" ) ;
1193- assert_eq ! ( sheet. get_formatted_value( "A6" ) , "ABCdef" ) ;
1208+
1209+ assert_eq ! ( sheet. get_cell( "A2" ) . unwrap( ) . get_value( ) , "11" ) ;
1210+ assert_eq ! ( sheet. get_cell( "A3" ) . unwrap( ) . get_value( ) , "22" ) ;
1211+ assert_eq ! ( sheet. get_cell( "A4" ) . unwrap( ) . get_value( ) , "ABCdef" ) ;
1212+ assert_eq ! ( sheet. get_cell( "A5" ) . unwrap( ) . get_value( ) , "ABCdef" ) ;
1213+ assert_eq ! ( sheet. get_cell( "A6" ) . unwrap( ) . get_value( ) , "ABCdef" ) ;
1214+
1215+ let path = std:: path:: Path :: new ( "./tests/result_files/wb_with_shared_strings.xlsx" ) ;
1216+ let _ = umya_spreadsheet:: writer:: xlsx:: write ( & book, path) ;
11941217}
0 commit comments