File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -544,10 +544,12 @@ object SetupApp {
544544 }
545545
546546 internal fun stdlibDependencyForPatch (wc3Patch : String? ): String {
547- return if (CoreJassProvider .isPre129Patch(wc3Patch)) {
548- " https://github.com/wurstscript/wurstStdlib2:pre1.29"
549- } else {
550- " https://github.com/wurstscript/wurstStdlib2"
547+ // wurstStdlib2 keeps era-specific branches. pre-1.24 must come first: it is a subset of pre-1.29,
548+ // and those oldest patches need the further-reduced pre1.24 stdlib (no APIs added in 1.24+).
549+ return when {
550+ CoreJassProvider .isPre124(wc3Patch) -> " https://github.com/wurstscript/wurstStdlib2:pre1.24"
551+ CoreJassProvider .isPre129Patch(wc3Patch) -> " https://github.com/wurstscript/wurstStdlib2:pre1.29"
552+ else -> " https://github.com/wurstscript/wurstStdlib2"
551553 }
552554 }
553555
Original file line number Diff line number Diff line change @@ -118,15 +118,21 @@ class GenerateTests {
118118
119119 @Test(priority = 10 )
120120 fun testStdlibDependencyFollowsPatchEra () {
121+ val pre124Stdlib = " https://github.com/wurstscript/wurstStdlib2:pre1.24"
121122 val legacyStdlib = " https://github.com/wurstscript/wurstStdlib2:pre1.29"
122123 val currentStdlib = " https://github.com/wurstscript/wurstStdlib2"
123124
124125 for (patch in CoreJassProvider .supportedPatches) {
125126 val minor = Regex (""" v1\.(\d+)""" ).find(patch)?.groupValues?.get(1 )?.toIntOrNull()
126- val expected = if (minor != null && minor < 29 ) legacyStdlib else currentStdlib
127+ val expected = when {
128+ minor != null && minor < 24 -> pre124Stdlib
129+ minor != null && minor < 29 -> legacyStdlib
130+ else -> currentStdlib
131+ }
127132 Assert .assertEquals(SetupApp .stdlibDependencyForPatch(patch), expected, " stdlib dependency for $patch " )
128133 }
129134
135+ Assert .assertEquals(SetupApp .stdlibDependencyForPatch(" v1.23a" ), pre124Stdlib)
130136 Assert .assertEquals(SetupApp .stdlibDependencyForPatch(" TFT-v1.27b-ru" ), legacyStdlib)
131137 Assert .assertEquals(SetupApp .stdlibDependencyForPatch(" pre1.29" ), legacyStdlib)
132138 Assert .assertEquals(SetupApp .stdlibDependencyForPatch(" v1.29" ), currentStdlib)
You can’t perform that action at this time.
0 commit comments