Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Wrong test name displayed for JUnit 4 parameterized test

未关闭
#1,562 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java, typescript
领域
testing-qa

调研方向

从 src/runners/junitRunner/JUnitRunnerResultAnalyzer.ts 中第 457 行附近的链接代码开始。使用 "()" 和 "(()" 等输入复现 JUnit 4 参数化测试,然后检查显示名称是如何从参数化名称派生出来的。当包含圆括号的名称能够被正确处理,且不会破坏其他示例输入时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

ai-triaged bug help wanted investigating junit low-priority ui

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:

image

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-java-test 的其他 Issue

查看 microsoft/vscode-java-test 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。