Wrong test name displayed for JUnit 4 parameterized test
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- java, typescript
- 领域
- testing-qa
调研方向
从 src/runners/junitRunner/JUnitRunnerResultAnalyzer.ts 中第 457 行附近的链接代码开始。使用 "()" 和 "(()" 等输入复现 JUnit 4 参数化测试,然后检查显示名称是如何从参数化名称派生出来的。当包含圆括号的名称能够被正确处理,且不会破坏其他示例输入时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Sample code:
@RunWith(Parameterized.class)
public class ParameterizedWithNameTest {
@Parameter
public int expected;
@Parameters(name = "{index}: expect={0}")
public static Collection<Object> data() {
// If using the name annotation param and one of the inputs has a rounded
// bracket, e.g. @Parameters(name = "test({index})"), then the test name needs
// to be properly handled.
return Arrays.asList(1, 2, "normalString", "()", "(()");
}
@Test
public void test() {
assertEquals(expected, 1);
}
}
Run the test will get:

Root cause is that here it's just check the position of (:
https://github.com/microsoft/vscode-java-test/blob/e7c10db82a0cbd0d8d11515fe51153a2e00cb584/src/runners/junitRunner/JUnitRunnerResultAnalyzer.ts#L457
- 主要语言
- TypeScript
- 星标
- 340
- 派生
- 173
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 17
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/vscode-java-test 的其他 Issue
-
ai-triaged bug investigating junit test-discovery test-execution
难度 4/5 3-5 天 新手友好度 42/100
microsoft/vscode-java-test#1897 · 1 条评论 ·
-
ai-triaged bug gradle high-priority test-execution
microsoft/vscode-java-test#1880 · 2 条评论 · 已指派 1 人 ·
-
ai-triaged gradle junit test-execution ux
microsoft/vscode-java-test#1878 · 3 条评论 · 已指派 1 人 ·
-
ai-triaged enhancement junit low-priority test-execution ui
难度 4/5 3-5 天 新手友好度 48/100
microsoft/vscode-java-test#1836 · 4 条评论 ·
-
ai-triaged enhancement gradle investigating junit low-priority test-reporting
难度 4/5 3-5 天 新手友好度 48/100
microsoft/vscode-java-test#1824 · 1 条评论 ·
查看 microsoft/vscode-java-test 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 1/5 1 小时以内 新手友好度 90/100
TanStack/tanstack.com#1293 ·