(t *testing.T)
| 28 | assert.Equal(t, object.GetReturnObject(), 11) |
| 29 | } |
| 30 | func TestCompiler_CompilerFor(t *testing.T) { |
| 31 | script := ` |
| 32 | int age = 0 ; |
| 33 | for(int i = 0;i<100;i++) { |
| 34 | age++; |
| 35 | } |
| 36 | return age; |
| 37 | ` |
| 38 | compiler := NewCompiler().Compiler(script) |
| 39 | object := compiler.(*ReturnObject) |
| 40 | fmt.Println(object.GetReturnObject()) |
| 41 | assert.Equal(t, object.GetReturnObject(), 100) |
| 42 | } |
| 43 | func TestCompiler_CompilerFor3(t *testing.T) { |
| 44 | script := ` |
| 45 | int age = 0 ; |
nothing calls this directly
no test coverage detected