From 7e8dc9ad66b1e337d9614d34c6377cb60031f6f1 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Sat, 7 Sep 2019 10:10:11 +0300 Subject: [PATCH] vm: uncomment TestForLoopBigIter It works just fine. --- pkg/vm/tests/for_test.go | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/pkg/vm/tests/for_test.go b/pkg/vm/tests/for_test.go index 0cc443451..70b063ffe 100644 --- a/pkg/vm/tests/for_test.go +++ b/pkg/vm/tests/for_test.go @@ -357,18 +357,16 @@ func TestDec(t *testing.T) { eval(t, src, big.NewInt(1)) } -// TODO: This could be a nasty bug. Output of the VM is 65695. -// Only happens above 100000, could be binary read issue. -//func TestForLoopBigIter(t *testing.T) { -// src := ` -// package foo -// func Main() int { -// x := 0 -// for i := 0; i < 100000; i++ { -// x = i -// } -// return x -// } -// ` -// eval(t, src, big.NewInt(99999)) -//} +func TestForLoopBigIter(t *testing.T) { + src := ` + package foo + func Main() int { + x := 0 + for i := 0; i < 100000; i++ { + x = i + } + return x + } + ` + eval(t, src, big.NewInt(99999)) +}