From 97ffbb90e5328cffb5248ed10912815af36e821d Mon Sep 17 00:00:00 2001 From: Fred Roth Date: Tue, 1 Aug 2023 09:35:53 +0200 Subject: [PATCH 1/2] Fix `test("capture value in closure")` The test broke with the update of scala 3.3.0 (#1225). However the old while loop did *not* capture the var so always created List(3,3,3). So it tested that the implementation is actually *wrong*. I changed the test to now use a fixed List. --- build.sbt | 2 +- tests/shared/src/test/scala/spire/syntax/CforSuite.scala | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/build.sbt b/build.sbt index 01e6726ec..dfe15f875 100644 --- a/build.sbt +++ b/build.sbt @@ -26,7 +26,7 @@ lazy val jscienceVersion = "4.3.1" lazy val apacheCommonsMath3Version = "3.6.1" val Scala213 = "2.13.10" -val Scala3 = "3.2.2" +val Scala3 = "3.3.0" Global / onChangedBuildSource := ReloadOnSourceChanges diff --git a/tests/shared/src/test/scala/spire/syntax/CforSuite.scala b/tests/shared/src/test/scala/spire/syntax/CforSuite.scala index 1fea3eef8..a4d4f514b 100644 --- a/tests/shared/src/test/scala/spire/syntax/CforSuite.scala +++ b/tests/shared/src/test/scala/spire/syntax/CforSuite.scala @@ -104,13 +104,7 @@ class CforSuite extends munit.FunSuite { cfor(0)(_ < 3, _ + 1) { x => b1 += (() => x) } - val b2 = collection.mutable.ArrayBuffer[() => Int]() - var i = 0 - while (i < 3) { - b2 += (() => i) - i += 1 - } - assertEquals(b1.map(_.apply()).toList, b2.map(_.apply()).toList) + assertEquals(b1.map(_.apply()).toList, List(0, 1, 2)) } test("capture value in inner class") { From de234958c9afd563dd353265ba2ae011b5de5919 Mon Sep 17 00:00:00 2001 From: Fred Roth Date: Tue, 1 Aug 2023 15:33:33 +0200 Subject: [PATCH 2/2] Regenerate github workflow --- .github/workflows/ci.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2567a9521..2e0628445 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,13 +28,13 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.13.10, 3.2.2] + scala: [2.13.10, 3.3.0] java: [temurin@8, temurin@11, temurin@17] project: [rootJS, rootJVM, rootNative] exclude: - - scala: 3.2.2 + - scala: 3.3.0 java: temurin@11 - - scala: 3.2.2 + - scala: 3.3.0 java: temurin@17 - project: rootJS java: temurin@11 @@ -257,32 +257,32 @@ jobs: tar xf targets.tar rm targets.tar - - name: Download target directories (3.2.2, rootJS) + - name: Download target directories (3.3.0, rootJS) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.2-rootJS + name: target-${{ matrix.os }}-${{ matrix.java }}-3.3.0-rootJS - - name: Inflate target directories (3.2.2, rootJS) + - name: Inflate target directories (3.3.0, rootJS) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (3.2.2, rootJVM) + - name: Download target directories (3.3.0, rootJVM) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.2-rootJVM + name: target-${{ matrix.os }}-${{ matrix.java }}-3.3.0-rootJVM - - name: Inflate target directories (3.2.2, rootJVM) + - name: Inflate target directories (3.3.0, rootJVM) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (3.2.2, rootNative) + - name: Download target directories (3.3.0, rootNative) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.2-rootNative + name: target-${{ matrix.os }}-${{ matrix.java }}-3.3.0-rootNative - - name: Inflate target directories (3.2.2, rootNative) + - name: Inflate target directories (3.3.0, rootNative) run: | tar xf targets.tar rm targets.tar