From 589aacbe80e31e37ab535249134b152c54c80b6f Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Wed, 11 May 2022 10:14:40 +0800 Subject: [PATCH] =?UTF-8?q?*=20=E5=A2=9E=E5=8A=A0=E9=83=A8=E5=88=86`xls`?= =?UTF-8?q?=E5=AE=B9=E9=94=99=20[Issue=20#2236](https://github.com/alibaba?= =?UTF-8?q?/easyexcel/issues/2236)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/compatibility/CompatibilityTest.java | 40 ++++++++++++++++++ .../src/test/resources/compatibility/t01.xls | Bin 0 -> 23552 bytes 2 files changed, 40 insertions(+) create mode 100644 easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/compatibility/CompatibilityTest.java create mode 100644 easyexcel-test/src/test/resources/compatibility/t01.xls diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/compatibility/CompatibilityTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/compatibility/CompatibilityTest.java new file mode 100644 index 00000000..790f4149 --- /dev/null +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/core/compatibility/CompatibilityTest.java @@ -0,0 +1,40 @@ +package com.alibaba.easyexcel.test.core.compatibility; + +import java.io.FileOutputStream; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +import com.alibaba.easyexcel.test.core.exception.ExceptionData; +import com.alibaba.easyexcel.test.util.TestFileUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.converters.WriteConverterContext; +import com.alibaba.excel.converters.floatconverter.FloatNumberConverter; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.fastjson.JSON; + +import lombok.extern.slf4j.Slf4j; +import org.junit.Assert; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +/** + * Compatible with some special files + * + * @author Jiaju Zhuang + */ +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +@Slf4j +public class CompatibilityTest { + + @Test + public void t01() { + // https://github.com/alibaba/easyexcel/issues/2236 + List> list = EasyExcel.read(TestFileUtil.getPath() + "compatibility/t01.xls").sheet() + .doReadSync(); + Assert.assertEquals(2, list.size()); + Map row1 = list.get(1); + Assert.assertEquals("Q235(碳钢)", row1.get(0)); + } +} diff --git a/easyexcel-test/src/test/resources/compatibility/t01.xls b/easyexcel-test/src/test/resources/compatibility/t01.xls new file mode 100644 index 0000000000000000000000000000000000000000..eb0782f5654a16acc49cd3334fceddc5f611b387 GIT binary patch literal 23552 zcmeG^2UHZYkqI>FHthzxV%n@1J+)-0rTrb*t*ut(&{&!gF%OH=_~2X+?eZyb*sf$gRfJ12%?ig=mXNT$S^X9)?*lh{DP|$ z5mEX;&l>u3vLgMH?hIuok^m(i4<+wNQsA2MISe>7)*zn(7|Vn@aFXhM+{Bm(tQSwl zk`eGrp>5v{Y9Wob31Y^OA@Dr19!?%0ALU}({apFjmaiyzqVA{)>W@6oHdrfFA6f&BupXJ^6Q*p1rgA zY_ZLueJlUP?w}3{#S4bKy4*^*l`876+Yq>8kHC~e^IqpziTI<+yUL%?ni_m^|DfSo zbL?vkP3SdLPttoHCkK~0EY#%V`u1|vVDHKecGXu3o6wLR3OBKI|=$R$0n zhOw^uib83+x%AbUzBYg>MfTBoexosdFjGAP^ora<#-VccsW2FohrmcYocO`~_IFO| zx49xJKPf);e}d;q;qs{gjTE_uuwaCXKcfS$OCRK8Otksz*1>0YJ>`-R#v0$kOoLnA z4m$AGI`BqjVIiZh>z$4yBZ4690iLXuGxPbsUJ671(eBlW*VAA0Y8 zu52Ouc_^RJWR9>(hxNHSRcS5`i4;0qSiUPUj9?WHTC9V(88DIZXf!z~32n)C98=kf zYzq(lylKrG#7)T#+%r(6(G0i*4rC{8D6j;;l9L}G2eAv;g+nlxg2#m>3nshi+Lr<$ zTZ_`R$qcB}Cs~ESx|7SdfO;8mWd*XbS zwgV3F7{rZf`)lKUb>NM3;O%wb9d+P6b>O{p;C1O^ql3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