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

Function TestCompiler_Compiler2

compiler_test.go:19–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17 NewCompiler().Compiler(script)
18}
19func TestCompiler_Compiler2(t *testing.T) {
20 script := `
21int a=10;
22a++;
23return a;
24`
25 compiler := NewCompiler().Compiler(script)
26 object := compiler.(*ReturnObject)
27 fmt.Println(object.GetReturnObject())
28 assert.Equal(t, object.GetReturnObject(), 11)
29}
30func TestCompiler_CompilerFor(t *testing.T) {
31 script := `
32int age = 0 ;

Callers

nothing calls this directly

Calls 3

NewCompilerFunction · 0.85
CompilerMethod · 0.80
GetReturnObjectMethod · 0.80

Tested by

no test coverage detected