(t *testing.T)
| 41 | assert.Equal(t, object.GetReturnObject(), 100) |
| 42 | } |
| 43 | func TestCompiler_CompilerFor3(t *testing.T) { |
| 44 | script := ` |
| 45 | int age = 0 ; |
| 46 | int sum=1; |
| 47 | for(int i = 0;i<100;i++) { |
| 48 | sum=sum+1; |
| 49 | for(int i = 0;i<100;i++) { |
| 50 | age++; |
| 51 | } |
| 52 | } |
| 53 | return age; |
| 54 | ` |
| 55 | compiler := NewCompiler().Compiler(script) |
| 56 | object := compiler.(*ReturnObject) |
| 57 | fmt.Println(object.GetReturnObject()) |
| 58 | assert.Equal(t, object.GetReturnObject(), 100*100) |
| 59 | } |
| 60 | func TestCompiler_CompilerFor2(t *testing.T) { |
| 61 | script := ` |
| 62 | int age = 1 ; |
nothing calls this directly
no test coverage detected