Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jcp19 committed May 19, 2024
1 parent 9699951 commit 036a1f5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/regressions/issues/000129-2.gobra
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 036a1f5

Please sign in to comment.