MCPcopy Create free account
hub / github.com/crossoverJie/gscript / TestArithmeticOperators

Function TestArithmeticOperators

visitor_test.go:90–101  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestArithmeticOperators(t *testing.T) {
91 expression := `
92if(4==(2+2)){
93 return 1+3;
94} else {
95 return false;
96}`
97 var result = NewCompiler().Compiler(expression)
98 fmt.Println(result)
99 object := result.(*ReturnObject)
100 assert.Equal(t, object.GetReturnObject(), 4)
101}
102func TestArithmeticOperators2(t *testing.T) {
103 expression := `(10+20)*20;`
104 var result = NewCompiler().Compiler(expression)

Callers

nothing calls this directly

Calls 3

NewCompilerFunction · 0.85
CompilerMethod · 0.80
GetReturnObjectMethod · 0.80

Tested by

no test coverage detected