代码之家  ›  专栏  ›  技术社区  ›  Andy897

csvfilesource junit 5跳过行

  •  0
  • Andy897  · 技术社区  · 6 年前

    我正在使用 @CsvFileSource JUnit5的注释,用于参数化我的测试用例,但是我不能忽略CSV文件中的注释。

    你有什么想法吗?

    范例CSV:

    apple fruit sweet
    carrot vegetable sweet
    // lemon vegetable sour  (Ignore this)
    banana fruit sweet
    
    0 回复  |  直到 6 年前
        1
  •  3
  •   eee    6 年前

    使用A # 在注释行的开头:

    apple, fruit, sweet
    carrot, vegetable, sweet
    # lemon, vegetable, sour
    banana, fruit, sweet