(t *testing.T)
| 71 | assert.Equal(t, object.GetReturnObject(), 101) |
| 72 | } |
| 73 | func TestCompiler_CompilerIf(t *testing.T) { |
| 74 | script := ` |
| 75 | int age=10; |
| 76 | if (age>10){ |
| 77 | age++; |
| 78 | }else{ |
| 79 | age--; |
| 80 | } |
| 81 | return age; |
| 82 | ` |
| 83 | compiler := NewCompiler().Compiler(script) |
| 84 | object := compiler.(*ReturnObject) |
| 85 | fmt.Println(object.GetReturnObject()) |
| 86 | assert.Equal(t, object.GetReturnObject(), 9) |
| 87 | } |
| 88 | func TestCompiler_CompilerIf2(t *testing.T) { |
| 89 | script := ` |
| 90 | int age=10; |
nothing calls this directly
no test coverage detected