Fix snippet test mismatch between hotspot and native test (#1797)

This commit is contained in:
Daniel Chao
2026-07-28 18:18:36 +00:00
committed by GitHub
parent 1a3dc52a96
commit be03023499
2 changed files with 5 additions and 2 deletions
@@ -1,3 +1,4 @@
pkl: TRACE: items = new Listing { ? } (file:///$snippetsDir/input/errors/traceThenIterateUndefinedMember.pkl)
–– Pkl Error ––
Tried to read property `undefinedValue` but its value is undefined.
@@ -24,4 +25,3 @@ at pkl.base#Module.output.text (pkl:base)
xxx | if (renderer is BytesRenderer) renderer.renderDocument(value) else text.encodeToBytes("UTF-8")
^^^^
at pkl.base#Module.output.bytes (pkl:base)
pkl: TRACE: items = new Listing { ? } (file:///$snippetsDir/input/errors/traceThenIterateUndefinedMember.pkl)
@@ -223,8 +223,11 @@ class LanguageSnippetTestsEngine : AbstractLanguageSnippetTestsEngine() {
val stderr = logWriter.toString().withUnixLineEndings()
// match native CLI: if an error happens, any WARN or TRACE gets emitted first, then the
// error message
val effectiveOutput = if (success) output + stderr else stderr + output
return (success && stderr.isBlank()) to
(output + stderr).stripFilePaths().stripWebsite().stripStdlibLocationSha()
effectiveOutput.stripFilePaths().stripWebsite().stripStdlibLocationSha()
}
}