mirror of
https://github.com/apple/pkl.git
synced 2026-03-24 01:51:19 +01: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() =
|
||||
replace("Pkl version is ${Release.current().version()}", "Pkl version is xxx")
|
||||
|
||||
protected fun String.stripStdlibLocationSha(): String =
|
||||
replace("https://github.com/apple/pkl/blob/${Release.current().commitId()}/stdlib/", "https://github.com/apple/pkl/blob/\$commitId/stdlib/")
|
||||
protected fun String.stripStdlibLocationSha(): String {
|
||||
// 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 {
|
||||
return if (System.lineSeparator() == "\r\n") replace("\r\n", "\n")
|
||||
|
||||
Reference in New Issue
Block a user