(t *testing.T)
| 58 | assert.Equal(t, object.GetReturnObject(), 100*100) |
| 59 | } |
| 60 | func TestCompiler_CompilerFor2(t *testing.T) { |
| 61 | script := ` |
| 62 | int age = 1 ; |
| 63 | for(int i = 0;i<100;i++) { |
| 64 | age=age+1; |
| 65 | } |
| 66 | return age; |
| 67 | ` |
| 68 | compiler := NewCompiler().Compiler(script) |
| 69 | object := compiler.(*ReturnObject) |
| 70 | fmt.Println(object.GetReturnObject()) |
| 71 | assert.Equal(t, object.GetReturnObject(), 101) |
| 72 | } |
| 73 | func TestCompiler_CompilerIf(t *testing.T) { |
| 74 | script := ` |
| 75 | int age=10; |
nothing calls this directly
no test coverage detected