agent/cmd/core-agent/main_example_test.go
Virgil 459a353c6b fix(ax): move version injection to module root
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 16:40:53 +00:00

32 lines
620 B
Go

// SPDX-License-Identifier: EUPL-1.2
package main
import (
agentpkg "dappco.re/go/agent"
core "dappco.re/go/core"
)
func Example_newCoreAgent() {
oldVersion := agentpkg.Version
agentpkg.Version = "0.15.0"
defer func() { agentpkg.Version = oldVersion }()
c := newCoreAgent()
core.Println(c.App().Name)
core.Println(c.App().Version)
core.Println(len(c.Commands()) >= 3)
// Output:
// core-agent
// 0.15.0
// true
}
func Example_appVersion() {
oldVersion := agentpkg.Version
agentpkg.Version = "0.15.0"
defer func() { agentpkg.Version = oldVersion }()
core.Println(appVersion())
// Output: 0.15.0
}