mirror of
https://github.com/apple/pkl.git
synced 2026-04-24 01:08:34 +02:00
Fix commitish detection in LanguageSnippetTest to also cover release versions (#537)
This commit is contained in:
committed by
GitHub
parent
600939457a
commit
d55866a04b
@@ -91,8 +91,16 @@ abstract class AbstractLanguageSnippetTestsEngine : InputOutputTestEngine() {
|
|||||||
protected fun String.stripVersionCheckErrorMessage() =
|
protected fun String.stripVersionCheckErrorMessage() =
|
||||||
replace("Pkl version is ${Release.current().version()}", "Pkl version is xxx")
|
replace("Pkl version is ${Release.current().version()}", "Pkl version is xxx")
|
||||||
|
|
||||||
protected fun String.stripStdlibLocationSha(): String =
|
protected fun String.stripStdlibLocationSha(): String {
|
||||||
replace("https://github.com/apple/pkl/blob/${Release.current().commitId()}/stdlib/", "https://github.com/apple/pkl/blob/\$commitId/stdlib/")
|
// Logic must be kept in-sync with `doc-package-info.pkl`.
|
||||||
|
val commitIsh =
|
||||||
|
if (Release.current().version().isNormal) Release.current().version()
|
||||||
|
else Release.current().commitId()
|
||||||
|
return replace(
|
||||||
|
"https://github.com/apple/pkl/blob/${commitIsh}/stdlib/",
|
||||||
|
"https://github.com/apple/pkl/blob/\$commitId/stdlib/"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
protected fun String.withUnixLineEndings(): String {
|
protected fun String.withUnixLineEndings(): String {
|
||||||
return if (System.lineSeparator() == "\r\n") replace("\r\n", "\n")
|
return if (System.lineSeparator() == "\r\n") replace("\r\n", "\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user