diff --git a/src/test/resources/regressions/features/maps/maps-simple1.gobra b/src/test/resources/regressions/features/maps/maps-simple1.gobra index 571d8437a..1b0d769ed 100644 --- a/src/test/resources/regressions/features/maps/maps-simple1.gobra +++ b/src/test/resources/regressions/features/maps/maps-simple1.gobra @@ -73,7 +73,8 @@ func test8() { m := map[string]int { "hello": 5, "bye": 3 } v, ok := m["hello"] assert ok && v == 5 - assert len(map[int]int{}) == 0 + e := map[int]int{} + assert len(e) == 0 } func test9() { diff --git a/src/test/resources/regressions/features/slices/slice-literal-simple1.gobra b/src/test/resources/regressions/features/slices/slice-literal-simple1.gobra index 888ea17d3..a12796c1d 100644 --- a/src/test/resources/regressions/features/slices/slice-literal-simple1.gobra +++ b/src/test/resources/regressions/features/slices/slice-literal-simple1.gobra @@ -11,15 +11,17 @@ func test1() { } func test2() { - s@ := [][]int{[]int{1}, []int{2}} + s@ := [][]int{[]int{1}, []int{2}} assert len(s) == 2 } func test3() { - assert len([]int { 1, 2, 3 }) == 3 - assert cap([]int { 4, 5 }[:]) == 2 - assert len([]int { 1, 2, 3 }[:2]) == 2 - assert cap([]int { 4, 5 }[1:]) == 1 + oneTwoThree := []int { 1, 2, 3 } + fourFive := []int { 4, 5 } + assert len(oneTwoThree) == 3 + assert cap(fourFive[:]) == 2 + assert len(oneTwoThree[:2]) == 2 + assert cap(fourFive[1:]) == 1 } func test4() { diff --git a/src/test/resources/regressions/issues/000129-2.gobra b/src/test/resources/regressions/issues/000129-2.gobra index 82b223a0c..56b874e62 100644 --- a/src/test/resources/regressions/issues/000129-2.gobra +++ b/src/test/resources/regressions/issues/000129-2.gobra @@ -4,7 +4,8 @@ package pkg func issue () { - assert []int{4: 20, 1: 10}[2] == 0 + s := []int{4: 20, 1: 10} + assert s[2] == 0 } func extra1() { diff --git a/src/test/scala/viper/gobra/typing/ExprTypingUnitTests.scala b/src/test/scala/viper/gobra/typing/ExprTypingUnitTests.scala index 7583beb60..c16a173a3 100644 --- a/src/test/scala/viper/gobra/typing/ExprTypingUnitTests.scala +++ b/src/test/scala/viper/gobra/typing/ExprTypingUnitTests.scala @@ -2843,7 +2843,7 @@ class ExprTypingUnitTests extends AnyFunSuite with Matchers with Inside { assert (frontend.wellDefExpr(expr)().valid) } - test("TypeChecker: should not let an array literal be classified as pure") { + test("TypeChecker: should classify an array literal containing only integer literals as pure") { val expr = PLiteral.array( PBoolType(), Vector(PIntLit(1), PIntLit(2))