代码之家  ›  专栏  ›  技术社区  ›  J'e

Catch2-无法重建长测试名称

  •  0
  • J'e  · 技术社区  · 5 年前

    使用 Catch2 Test Adapter 在Visual Studio 2017中,我的一些测试中出现了错误,其中包括很长的场景名称。我不知道确切的长度阈值,但它似乎发生在 情节 字符串长度约为80个字符或更多。除了使用较短的场景值,还有什么方法可以解决这个问题吗?

    示例场景,

    SCENARIO("I want to be the very best, Like no one ever was. To catch them is my real test, To train them is my cause!")
    {
        ...
    }
    

    visual studio首次加载和扫描测试时的错误示例,

    Error: Unable to reconstruct long test name
      Source: C:\foo\bar\baz\Debug\CatchTests.exe
      Name: Scenario: I want to be the very best, Like no one ever was.{???} To catch them is my real test, To train them is my cause!
      File: C:\foo\bar\baz\src\myTest.cpp
      Line: 123
    
    0 回复  |  直到 5 年前
    推荐文章