Uncomment block skipped tests.
package main
import (
- "testing"
"github.com/st0012/Rooby/vm"
+ "testing"
)
func TestPrimitiveType(t *testing.T) {
@@ -762,6 +762,23 @@ end
car.doors
`,
4},
+ {`
+ class Foo
+ def bar(x)
+ yield(x)
+ end
+ end
+
+ f = Foo.new
+ x = 100
+ y = 10
+
+ f.bar(10) do |x|
+ y = x + y
+ end
+
+ y
+ `, 20},
}
for _, tt := range tests {
@@ -797,6 +814,28 @@ func TestMethodCallWithNestedBlock(t *testing.T) {
i
`, 303},
+ {`
+ class Foo
+ def bar
+ yield
+ end
+ end
+
+ i = 10
+ a = 100
+ b = 1000
+
+ f = Foo.new
+
+ f.bar do
+ a = 20
+ f.bar do
+ b = (3 + i) * a
+ end
+ end
+ b
+
+ `, 260},
}
for _, tt := range tests {
