给定一个简单的测试方法,注释为@ParameterizedTest
,通过注释使用输入@CsvSource
(例如@CsvSource({ "@", "*", "#", "?", "-", "$", "!", "0" }
)。在运行所述测试时,测试"#"
会在应该测试时立即中断。阅读堆栈跟踪/异常时,我发现以下内容:
org.junit.jupiter.params.shadow.com.univocity.parsers.common.TextParsingException: java.lang.IllegalArgumentException - Unable to skip 1 lines from line 2. End of input reached
Parser Configuration: CsvParserSettings:
...
CsvFormat:
Comment character=#
Field delimiter=,
Line separator (normalized)=\n
Line separator sequence=\r\n
Quote character='
Quote escape character='
Quote escape escape character=null
我猜问题出在最后一个块(Comment character=#
)中:特定参数被作为注释读取。如何更改此设置?