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

Function TestArithmeticOperators5

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

Source from the content-addressed store, hash-verified

129
130}
131func TestArithmeticOperators5(t *testing.T) {
132 expression := `
133if ( (10 +10 ) == 20 ) {
134 return 10++ ;
135} else {
136 return 20 ;
137}
138`
139 var result = NewCompiler().Compiler(expression)
140 fmt.Println(result)
141 object := result.(*ReturnObject)
142 assert.Equal(t, object.GetReturnObject(), 11)
143}
144func TestArithmeticOperators6(t *testing.T) {
145 expression := `
146if ( (10 +10 ) == 20 ) {

Callers

nothing calls this directly

Calls 3

NewCompilerFunction · 0.85
CompilerMethod · 0.80
GetReturnObjectMethod · 0.80

Tested by

no test coverage detected