未验证 提交 4711d622 编写于 作者: E Eugene Auduchinok 提交者: GitHub

Tests/syntax: produce tmp file when result doesn't match the baseline (#15089)

* Tests/syntax: produce tmp file when result doesn't match baselines

* Delete tmp file when results matches

* Rename tmp -> actual

* Ignore tmp files in git
上级 88b14c4d
......@@ -176,7 +176,9 @@ let ParseFile fileName =
$"%A{ast}\n\n%s{diagnostics}"
|> normalize
|> sprintf "%s\n"
let bslPath = $"{fullPath}.bsl"
let actualPath = $"{fullPath}.actual"
let expected =
if File.Exists bslPath then
......@@ -184,9 +186,14 @@ let ParseFile fileName =
else
"No baseline was found"
let equals = expected = actual
let testUpdateBSLEnv = System.Environment.GetEnvironmentVariable("TEST_UPDATE_BSL")
if not (isNull testUpdateBSLEnv) && testUpdateBSLEnv.Trim() = "1" then
File.WriteAllText(bslPath, actual)
elif not equals then
File.WriteAllText(actualPath, actual)
else
File.Delete(actualPath)
Assert.AreEqual(expected, actual)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册