Added core tests
All checks were successful
/ test (push) Successful in 14s

This commit is contained in:
Eduard Urbach 2025-06-20 15:52:13 +02:00
parent fe3212506d
commit ed6ae1d306
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
4 changed files with 37 additions and 32 deletions

20
src/core/Function_test.go Normal file
View 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)
}