Test: Output JSON AST as array when it involves multiple sources

This commit is contained in:
Mathias Baumann 2020-05-19 14:26:08 +02:00
parent c3d87a0091
commit 5a7217b90e
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,4 @@
[
{
"absolutePath": "a",
"exportedSymbols":
@ -218,3 +219,4 @@
],
"src": "0:160:3"
}
]

View File

@ -140,6 +140,9 @@ TestCase::TestResult ASTJSONTest::run(ostream& _stream, string const& _linePrefi
return TestResult::FatalError;
}
if (m_sources.size() > 1)
m_result += "[\n";
for (size_t i = 0; i < m_sources.size(); i++)
{
ostringstream result;
@ -150,6 +153,9 @@ TestCase::TestResult ASTJSONTest::run(ostream& _stream, string const& _linePrefi
m_result += "\n";
}
if (m_sources.size() > 1)
m_result += "]\n";
bool resultsMatch = true;
replaceTagWithVersion(m_expectation);