This commit is contained in:
parent
fe3212506d
commit
ed6ae1d306
4 changed files with 37 additions and 32 deletions
20
src/core/Function_test.go
Normal file
20
src/core/Function_test.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package core_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.urbach.dev/cli/q/src/build"
|
||||
"git.urbach.dev/cli/q/src/compiler"
|
||||
"git.urbach.dev/go/assert"
|
||||
)
|
||||
|
||||
func TestFunction(t *testing.T) {
|
||||
b := build.New("../../examples/hello")
|
||||
env, err := compiler.Compile(b)
|
||||
assert.Nil(t, err)
|
||||
main, exists := env.Functions["main.main"]
|
||||
assert.True(t, exists)
|
||||
assert.False(t, main.IsExtern())
|
||||
assert.Equal(t, main.UniqueName, "main.main")
|
||||
assert.Equal(t, main.String(), main.UniqueName)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue