diff options
author | Giovanni Bajo <rasky@develer.com> | 2018-04-02 03:17:18 +0200 |
---|---|---|
committer | Giovanni Bajo <rasky@develer.com> | 2018-04-29 09:38:09 +0000 |
commit | 980fdb8dd5fe0151a9b7e84ec6b8c20a11727521 (patch) | |
tree | 5823ed517bf407ba67c8a501c59430e8d4a14706 /test/prove.go | |
parent | f49369b67ce8858f5f7ac4e41580e62a289d73df (diff) | |
download | go-git-980fdb8dd5fe0151a9b7e84ec6b8c20a11727521.tar.gz |
cmd/compile: improve testing of induction variables
Test both minimum and maximum bound, and prepare
formatting for more advanced tests (inclusive / esclusive bounds).
Change-Id: Ibe432916d9c938343bc07943798bc9709ad71845
Reviewed-on: https://go-review.googlesource.com/104040
Run-TryBot: Giovanni Bajo <rasky@develer.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'test/prove.go')
-rw-r--r-- | test/prove.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/prove.go b/test/prove.go index a4eedbb717..b5b3f20082 100644 --- a/test/prove.go +++ b/test/prove.go @@ -62,7 +62,7 @@ func f1c(a []int, i int64) int { } func f2(a []int) int { - for i := range a { // ERROR "Induction variable with minimum 0 and increment 1" + for i := range a { // ERROR "Induction variable: limits \[0,\?\), increment 1" a[i+1] = i a[i+1] = i // ERROR "Proved IsInBounds$" } @@ -464,7 +464,7 @@ func f16(s []int) []int { } func f17(b []int) { - for i := 0; i < len(b); i++ { // ERROR "Induction variable with minimum 0 and increment 1" + for i := 0; i < len(b); i++ { // ERROR "Induction variable: limits \[0,\?\), increment 1" // This tests for i <= cap, which we can only prove // using the derived relation between len and cap. // This depends on finding the contradiction, since we |