英文:
Unit test failure on building of Jackson-Core Version 2.11.2
问题
在手动构建使用最新版本2.11.2的jackson-core模块的过程中,我在单元测试中遇到了一个错误;我猜测这可能是因为我的笔记本电脑上的设置问题。
执行的步骤:
- Java版本 -> 1.8
- 克隆jackson-core仓库
git checkout tags/jackson-core-2.11.2
mvn package
结果:
[INFO] 运行测试: 3个,失败: 0个,错误: 0个,跳过: 0个,耗时: 0.004秒 - 位于 com.fasterxml.jackson.core.type.TypeReferenceTest
[INFO] 运行测试: 1个,失败: 0个,错误: 0个,跳过: 0个,耗时: 0.005秒 - 位于 com.fasterxml.jackson.core.util.ByteArrayBuilderTest
[INFO] 运行测试: 2个,失败: 1个,错误: 0个,跳过: 0个,耗时: 0.006秒 <<< 失败!- 位于 com.fasterxml.jackson.core.util.DefaultIndenterTest
[ERROR] testWithIndent(com.fasterxml.jackson.core.util.DefaultIndenterTest) 耗时: 0.002秒 <<< 失败!
org.junit.ComparisonFailure:
期望值: <[]
但实际值: <[
] >
位于 com.fasterxml.jackson.core.util.DefaultIndenterTest.testWithIndent(DefaultIndenterTest.java:32)
[INFO] 运行测试: 4个,失败: 0个,错误: 0个,跳过: 0个,耗时: 0.007秒 - 位于 com.fasterxml.jackson.core.util.RequestPayloadTest
[INFO] 运行测试: ...(部分内容省略)
[INFO]
[INFO] 结果:
[INFO]
[ERROR] 失败项:
[ERROR] DefaultIndenterTest.testWithIndent:32 期望值: <[] 但实际值: <[
] >
[INFO]
[ERROR] 运行测试: 895个,失败: 1个,错误: 0个,跳过: 0个
[INFO]
[ERROR] 存在测试失败。
问题:
我想知道在笔记本电脑上可能出了什么设置问题,导致单元测试失败?
英文:
In the process of manually building the jackson-core module using the latest version of 2.11.2 I am encountering an error in the unit tests; which I'm assuming is due to a setting issue on my laptop.
Steps Performed:
- Java Version -> 1.8
- clone jackson-core repo
git checkout tags/jackson-core-2.11.2
mvn package
Result:
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s - in com.fasterxml.jackson.core.type.TypeReferenceTest
[INFO] Running com.fasterxml.jackson.core.util.ByteArrayBuilderTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s - in com.fasterxml.jackson.core.util.ByteArrayBuilderTest
[INFO] Running com.fasterxml.jackson.core.util.DefaultIndenterTest
[ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.006 s <<< FAILURE! - in com.fasterxml.jackson.core.util.DefaultIndenterTest
[ERROR] testWithIndent(com.fasterxml.jackson.core.util.DefaultIndenterTest) Time elapsed: 0.002 s <<< FAILURE!
org.junit.ComparisonFailure:
expected:<[]
] but was:<[
>
at com.fasterxml.jackson.core.util.DefaultIndenterTest.testWithIndent(DefaultIndenterTest.java:32)
[INFO] Running com.fasterxml.jackson.core.util.RequestPayloadTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 s - in com.fasterxml.jackson.core.util.RequestPayloadTest
[INFO] Running com.fasterxml.jackson.core.util.SeparatorsTest
....
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] DefaultIndenterTest.testWithIndent:32 expected:<[]
] but was:<[
>
[INFO]
[ERROR] Tests run: 895, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[ERROR] There are test failures.
Question:
I was wondering what setting could be wrong on the laptop that is causing the failure in the Unit tests?
答案1
得分: 0
查看他们的代码,特别是那个特定的单元测试,他们将\n
视为Eol
(行尾结束符)进行比较。
我认为你看到的错误可能与你所使用的操作系统有关,因为在不同操作系统之间可能会有差异。
英文:
Looking at their code, specially at the specific unit test, they are comparing \n
as the Eol
.
I believe the error you are seeing could be related to the OS you are running on as it might differ between them.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论