refactor: migrate core/agent to Core primitives — reference implementation
Phase 1: go-io/go-log → core.Fs{}, core.E(), core.Error/Info/Warn
Phase 2: strings/fmt → core.Contains, core.Sprintf, core.Split etc
Phase 3: embed.FS → core.Mount/core.Embed, core.Extract
Phase 4: cmd/main.go → core.Command(), c.Cli().Run(), no cli package
All packages migrated:
- pkg/lib (Codex): core.Mount, core.Extract, Result returns, AX comments
- pkg/setup (Codex): core.Fs, core.E, fixed missing lib helpers
- pkg/brain (Codex): Core primitives, AX comments
- pkg/monitor (Codex): Core string/logging primitives
- pkg/agentic (Codex): 20 files, Core primitives throughout
- cmd/main.go: pure Core CLI, no fmt/log/filepath/strings/cli
Remaining stdlib: path/filepath (Core doesn't wrap OS paths),
fmt.Sscanf/strings.Map (no Core equivalent).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 06:13:41 +00:00
|
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
|
|
|
|
|
package setup
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
|
feat(v0.8.0): full AX migration — ServiceRuntime, Actions, quality gates, transport
go-process:
- Register factory, Result lifecycle, 5 named Action handlers
- Start/Run/StartWithOptions/RunWithOptions all return core.Result
- core.ID() replaces fmt.Sprintf, core.As replaces errors.As
core/agent:
- PrepSubsystem + monitor.Subsystem + setup.Service embed ServiceRuntime[T]
- 22 named Actions + agent.completion Task pipeline in OnStartup
- ChannelNotifier removed — all IPC via c.ACTION(messages.X{})
- proc.go: all methods via s.Core().Process(), returns core.Result
- status.go: WriteAtomic + JSONMarshalString
- paths.go: Fs.NewUnrestricted() replaces unsafe.Pointer
- transport.go: ONE net/http file — HTTPGet/HTTPPost/HTTPDo/MCP transport
- All disallowed imports eliminated from source files (13 quality gates)
- String concat eliminated — core.Concat() throughout
- 1:1 _test.go + _example_test.go for every source file
- Reference docs synced from core/go v0.8.0
- RFC-025 updated with net/http, net/url, io/fs quality gates
- lib.go: io/fs eliminated via Data.ListNames, Array[T].Deduplicate
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 01:27:46 +00:00
|
|
|
core "dappco.re/go/core"
|
refactor: migrate core/agent to Core primitives — reference implementation
Phase 1: go-io/go-log → core.Fs{}, core.E(), core.Error/Info/Warn
Phase 2: strings/fmt → core.Contains, core.Sprintf, core.Split etc
Phase 3: embed.FS → core.Mount/core.Embed, core.Extract
Phase 4: cmd/main.go → core.Command(), c.Cli().Run(), no cli package
All packages migrated:
- pkg/lib (Codex): core.Mount, core.Extract, Result returns, AX comments
- pkg/setup (Codex): core.Fs, core.E, fixed missing lib helpers
- pkg/brain (Codex): Core primitives, AX comments
- pkg/monitor (Codex): Core string/logging primitives
- pkg/agentic (Codex): 20 files, Core primitives throughout
- cmd/main.go: pure Core CLI, no fmt/log/filepath/strings/cli
Remaining stdlib: path/filepath (Core doesn't wrap OS paths),
fmt.Sscanf/strings.Map (no Core equivalent).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 06:13:41 +00:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
)
|
|
|
|
|
|
2026-03-29 21:34:46 +00:00
|
|
|
func newSetupService() *Service {
|
feat(v0.8.0): full AX migration — ServiceRuntime, Actions, quality gates, transport
go-process:
- Register factory, Result lifecycle, 5 named Action handlers
- Start/Run/StartWithOptions/RunWithOptions all return core.Result
- core.ID() replaces fmt.Sprintf, core.As replaces errors.As
core/agent:
- PrepSubsystem + monitor.Subsystem + setup.Service embed ServiceRuntime[T]
- 22 named Actions + agent.completion Task pipeline in OnStartup
- ChannelNotifier removed — all IPC via c.ACTION(messages.X{})
- proc.go: all methods via s.Core().Process(), returns core.Result
- status.go: WriteAtomic + JSONMarshalString
- paths.go: Fs.NewUnrestricted() replaces unsafe.Pointer
- transport.go: ONE net/http file — HTTPGet/HTTPPost/HTTPDo/MCP transport
- All disallowed imports eliminated from source files (13 quality gates)
- String concat eliminated — core.Concat() throughout
- 1:1 _test.go + _example_test.go for every source file
- Reference docs synced from core/go v0.8.0
- RFC-025 updated with net/http, net/url, io/fs quality gates
- lib.go: io/fs eliminated via Data.ListNames, Array[T].Deduplicate
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 01:27:46 +00:00
|
|
|
c := core.New()
|
2026-03-30 20:53:36 +00:00
|
|
|
return &Service{ServiceRuntime: core.NewServiceRuntime(c, RuntimeOptions{})}
|
feat(v0.8.0): full AX migration — ServiceRuntime, Actions, quality gates, transport
go-process:
- Register factory, Result lifecycle, 5 named Action handlers
- Start/Run/StartWithOptions/RunWithOptions all return core.Result
- core.ID() replaces fmt.Sprintf, core.As replaces errors.As
core/agent:
- PrepSubsystem + monitor.Subsystem + setup.Service embed ServiceRuntime[T]
- 22 named Actions + agent.completion Task pipeline in OnStartup
- ChannelNotifier removed — all IPC via c.ACTION(messages.X{})
- proc.go: all methods via s.Core().Process(), returns core.Result
- status.go: WriteAtomic + JSONMarshalString
- paths.go: Fs.NewUnrestricted() replaces unsafe.Pointer
- transport.go: ONE net/http file — HTTPGet/HTTPPost/HTTPDo/MCP transport
- All disallowed imports eliminated from source files (13 quality gates)
- String concat eliminated — core.Concat() throughout
- 1:1 _test.go + _example_test.go for every source file
- Reference docs synced from core/go v0.8.0
- RFC-025 updated with net/http, net/url, io/fs quality gates
- lib.go: io/fs eliminated via Data.ListNames, Array[T].Deduplicate
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 01:27:46 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-29 21:34:46 +00:00
|
|
|
func TestSetup_Run_Good_WritesCoreConfigs(t *testing.T) {
|
refactor: migrate core/agent to Core primitives — reference implementation
Phase 1: go-io/go-log → core.Fs{}, core.E(), core.Error/Info/Warn
Phase 2: strings/fmt → core.Contains, core.Sprintf, core.Split etc
Phase 3: embed.FS → core.Mount/core.Embed, core.Extract
Phase 4: cmd/main.go → core.Command(), c.Cli().Run(), no cli package
All packages migrated:
- pkg/lib (Codex): core.Mount, core.Extract, Result returns, AX comments
- pkg/setup (Codex): core.Fs, core.E, fixed missing lib helpers
- pkg/brain (Codex): Core primitives, AX comments
- pkg/monitor (Codex): Core string/logging primitives
- pkg/agentic (Codex): 20 files, Core primitives throughout
- cmd/main.go: pure Core CLI, no fmt/log/filepath/strings/cli
Remaining stdlib: path/filepath (Core doesn't wrap OS paths),
fmt.Sscanf/strings.Map (no Core equivalent).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 06:13:41 +00:00
|
|
|
dir := t.TempDir()
|
2026-03-26 01:39:41 +00:00
|
|
|
require.True(t, fs.WriteMode(core.JoinPath(dir, "go.mod"), "module example.com/test\n", 0644).OK)
|
refactor: migrate core/agent to Core primitives — reference implementation
Phase 1: go-io/go-log → core.Fs{}, core.E(), core.Error/Info/Warn
Phase 2: strings/fmt → core.Contains, core.Sprintf, core.Split etc
Phase 3: embed.FS → core.Mount/core.Embed, core.Extract
Phase 4: cmd/main.go → core.Command(), c.Cli().Run(), no cli package
All packages migrated:
- pkg/lib (Codex): core.Mount, core.Extract, Result returns, AX comments
- pkg/setup (Codex): core.Fs, core.E, fixed missing lib helpers
- pkg/brain (Codex): Core primitives, AX comments
- pkg/monitor (Codex): Core string/logging primitives
- pkg/agentic (Codex): 20 files, Core primitives throughout
- cmd/main.go: pure Core CLI, no fmt/log/filepath/strings/cli
Remaining stdlib: path/filepath (Core doesn't wrap OS paths),
fmt.Sscanf/strings.Map (no Core equivalent).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 06:13:41 +00:00
|
|
|
|
2026-03-29 23:01:10 +00:00
|
|
|
result := newSetupService().Run(Options{Path: dir})
|
|
|
|
|
require.True(t, result.OK)
|
refactor: migrate core/agent to Core primitives — reference implementation
Phase 1: go-io/go-log → core.Fs{}, core.E(), core.Error/Info/Warn
Phase 2: strings/fmt → core.Contains, core.Sprintf, core.Split etc
Phase 3: embed.FS → core.Mount/core.Embed, core.Extract
Phase 4: cmd/main.go → core.Command(), c.Cli().Run(), no cli package
All packages migrated:
- pkg/lib (Codex): core.Mount, core.Extract, Result returns, AX comments
- pkg/setup (Codex): core.Fs, core.E, fixed missing lib helpers
- pkg/brain (Codex): Core primitives, AX comments
- pkg/monitor (Codex): Core string/logging primitives
- pkg/agentic (Codex): 20 files, Core primitives throughout
- cmd/main.go: pure Core CLI, no fmt/log/filepath/strings/cli
Remaining stdlib: path/filepath (Core doesn't wrap OS paths),
fmt.Sscanf/strings.Map (no Core equivalent).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 06:13:41 +00:00
|
|
|
|
2026-03-26 01:39:41 +00:00
|
|
|
build := fs.Read(core.JoinPath(dir, ".core", "build.yaml"))
|
refactor: migrate core/agent to Core primitives — reference implementation
Phase 1: go-io/go-log → core.Fs{}, core.E(), core.Error/Info/Warn
Phase 2: strings/fmt → core.Contains, core.Sprintf, core.Split etc
Phase 3: embed.FS → core.Mount/core.Embed, core.Extract
Phase 4: cmd/main.go → core.Command(), c.Cli().Run(), no cli package
All packages migrated:
- pkg/lib (Codex): core.Mount, core.Extract, Result returns, AX comments
- pkg/setup (Codex): core.Fs, core.E, fixed missing lib helpers
- pkg/brain (Codex): Core primitives, AX comments
- pkg/monitor (Codex): Core string/logging primitives
- pkg/agentic (Codex): 20 files, Core primitives throughout
- cmd/main.go: pure Core CLI, no fmt/log/filepath/strings/cli
Remaining stdlib: path/filepath (Core doesn't wrap OS paths),
fmt.Sscanf/strings.Map (no Core equivalent).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 06:13:41 +00:00
|
|
|
require.True(t, build.OK)
|
|
|
|
|
assert.Contains(t, build.Value.(string), "type: go")
|
|
|
|
|
|
2026-03-26 01:39:41 +00:00
|
|
|
test := fs.Read(core.JoinPath(dir, ".core", "test.yaml"))
|
refactor: migrate core/agent to Core primitives — reference implementation
Phase 1: go-io/go-log → core.Fs{}, core.E(), core.Error/Info/Warn
Phase 2: strings/fmt → core.Contains, core.Sprintf, core.Split etc
Phase 3: embed.FS → core.Mount/core.Embed, core.Extract
Phase 4: cmd/main.go → core.Command(), c.Cli().Run(), no cli package
All packages migrated:
- pkg/lib (Codex): core.Mount, core.Extract, Result returns, AX comments
- pkg/setup (Codex): core.Fs, core.E, fixed missing lib helpers
- pkg/brain (Codex): Core primitives, AX comments
- pkg/monitor (Codex): Core string/logging primitives
- pkg/agentic (Codex): 20 files, Core primitives throughout
- cmd/main.go: pure Core CLI, no fmt/log/filepath/strings/cli
Remaining stdlib: path/filepath (Core doesn't wrap OS paths),
fmt.Sscanf/strings.Map (no Core equivalent).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 06:13:41 +00:00
|
|
|
require.True(t, test.OK)
|
|
|
|
|
assert.Contains(t, test.Value.(string), "go test ./...")
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-29 21:34:46 +00:00
|
|
|
func TestSetup_Run_Good_TemplateAlias(t *testing.T) {
|
refactor: migrate core/agent to Core primitives — reference implementation
Phase 1: go-io/go-log → core.Fs{}, core.E(), core.Error/Info/Warn
Phase 2: strings/fmt → core.Contains, core.Sprintf, core.Split etc
Phase 3: embed.FS → core.Mount/core.Embed, core.Extract
Phase 4: cmd/main.go → core.Command(), c.Cli().Run(), no cli package
All packages migrated:
- pkg/lib (Codex): core.Mount, core.Extract, Result returns, AX comments
- pkg/setup (Codex): core.Fs, core.E, fixed missing lib helpers
- pkg/brain (Codex): Core primitives, AX comments
- pkg/monitor (Codex): Core string/logging primitives
- pkg/agentic (Codex): 20 files, Core primitives throughout
- cmd/main.go: pure Core CLI, no fmt/log/filepath/strings/cli
Remaining stdlib: path/filepath (Core doesn't wrap OS paths),
fmt.Sscanf/strings.Map (no Core equivalent).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 06:13:41 +00:00
|
|
|
dir := t.TempDir()
|
2026-03-26 01:39:41 +00:00
|
|
|
require.True(t, fs.WriteMode(core.JoinPath(dir, "go.mod"), "module example.com/test\n", 0644).OK)
|
refactor: migrate core/agent to Core primitives — reference implementation
Phase 1: go-io/go-log → core.Fs{}, core.E(), core.Error/Info/Warn
Phase 2: strings/fmt → core.Contains, core.Sprintf, core.Split etc
Phase 3: embed.FS → core.Mount/core.Embed, core.Extract
Phase 4: cmd/main.go → core.Command(), c.Cli().Run(), no cli package
All packages migrated:
- pkg/lib (Codex): core.Mount, core.Extract, Result returns, AX comments
- pkg/setup (Codex): core.Fs, core.E, fixed missing lib helpers
- pkg/brain (Codex): Core primitives, AX comments
- pkg/monitor (Codex): Core string/logging primitives
- pkg/agentic (Codex): 20 files, Core primitives throughout
- cmd/main.go: pure Core CLI, no fmt/log/filepath/strings/cli
Remaining stdlib: path/filepath (Core doesn't wrap OS paths),
fmt.Sscanf/strings.Map (no Core equivalent).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 06:13:41 +00:00
|
|
|
|
2026-03-29 23:01:10 +00:00
|
|
|
result := newSetupService().Run(Options{Path: dir, Template: "agent"})
|
|
|
|
|
require.True(t, result.OK)
|
refactor: migrate core/agent to Core primitives — reference implementation
Phase 1: go-io/go-log → core.Fs{}, core.E(), core.Error/Info/Warn
Phase 2: strings/fmt → core.Contains, core.Sprintf, core.Split etc
Phase 3: embed.FS → core.Mount/core.Embed, core.Extract
Phase 4: cmd/main.go → core.Command(), c.Cli().Run(), no cli package
All packages migrated:
- pkg/lib (Codex): core.Mount, core.Extract, Result returns, AX comments
- pkg/setup (Codex): core.Fs, core.E, fixed missing lib helpers
- pkg/brain (Codex): Core primitives, AX comments
- pkg/monitor (Codex): Core string/logging primitives
- pkg/agentic (Codex): 20 files, Core primitives throughout
- cmd/main.go: pure Core CLI, no fmt/log/filepath/strings/cli
Remaining stdlib: path/filepath (Core doesn't wrap OS paths),
fmt.Sscanf/strings.Map (no Core equivalent).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 06:13:41 +00:00
|
|
|
|
2026-03-26 01:39:41 +00:00
|
|
|
prompt := fs.Read(core.JoinPath(dir, "PROMPT.md"))
|
refactor: migrate core/agent to Core primitives — reference implementation
Phase 1: go-io/go-log → core.Fs{}, core.E(), core.Error/Info/Warn
Phase 2: strings/fmt → core.Contains, core.Sprintf, core.Split etc
Phase 3: embed.FS → core.Mount/core.Embed, core.Extract
Phase 4: cmd/main.go → core.Command(), c.Cli().Run(), no cli package
All packages migrated:
- pkg/lib (Codex): core.Mount, core.Extract, Result returns, AX comments
- pkg/setup (Codex): core.Fs, core.E, fixed missing lib helpers
- pkg/brain (Codex): Core primitives, AX comments
- pkg/monitor (Codex): Core string/logging primitives
- pkg/agentic (Codex): 20 files, Core primitives throughout
- cmd/main.go: pure Core CLI, no fmt/log/filepath/strings/cli
Remaining stdlib: path/filepath (Core doesn't wrap OS paths),
fmt.Sscanf/strings.Map (no Core equivalent).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 06:13:41 +00:00
|
|
|
require.True(t, prompt.OK)
|
|
|
|
|
assert.Contains(t, prompt.Value.(string), "This workspace was scaffolded by pkg/setup.")
|
|
|
|
|
}
|
2026-03-29 21:34:46 +00:00
|
|
|
|
2026-03-29 22:35:34 +00:00
|
|
|
func TestSetup_Run_Bad_MissingTemplateDoesNotWrite(t *testing.T) {
|
|
|
|
|
dir := t.TempDir()
|
|
|
|
|
require.True(t, fs.WriteMode(core.JoinPath(dir, "go.mod"), "module example.com/test\n", 0644).OK)
|
|
|
|
|
|
2026-03-29 23:01:10 +00:00
|
|
|
result := newSetupService().Run(Options{Path: dir, Template: "missing-template"})
|
|
|
|
|
require.False(t, result.OK)
|
|
|
|
|
require.Error(t, result.Value.(error))
|
2026-03-29 22:35:34 +00:00
|
|
|
assert.False(t, fs.Exists(core.JoinPath(dir, ".core")))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestSetup_Run_Ugly_DryRunDoesNotWrite(t *testing.T) {
|
|
|
|
|
dir := t.TempDir()
|
|
|
|
|
require.True(t, fs.WriteMode(core.JoinPath(dir, "go.mod"), "module example.com/test\n", 0644).OK)
|
|
|
|
|
|
2026-03-29 23:01:10 +00:00
|
|
|
result := newSetupService().Run(Options{Path: dir, Template: "agent", DryRun: true})
|
|
|
|
|
require.True(t, result.OK)
|
2026-03-29 22:35:34 +00:00
|
|
|
assert.False(t, fs.Exists(core.JoinPath(dir, ".core")))
|
|
|
|
|
assert.False(t, fs.Exists(core.JoinPath(dir, "PROMPT.md")))
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-29 21:34:46 +00:00
|
|
|
func TestSetup_ResolveTemplateName_Good_Auto(t *testing.T) {
|
2026-03-29 23:01:10 +00:00
|
|
|
name := resolveTemplateName("auto", TypeGo)
|
|
|
|
|
require.True(t, name.OK)
|
|
|
|
|
assert.Equal(t, "default", name.Value.(string))
|
2026-03-29 21:34:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestSetup_ResolveTemplateName_Bad_Empty(t *testing.T) {
|
2026-03-29 23:01:10 +00:00
|
|
|
result := resolveTemplateName("", TypeGo)
|
|
|
|
|
require.False(t, result.OK)
|
|
|
|
|
require.Error(t, result.Value.(error))
|
2026-03-29 21:34:46 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-29 22:35:34 +00:00
|
|
|
func TestSetup_ResolveTemplateName_Ugly_ConventionsAlias(t *testing.T) {
|
2026-03-29 23:01:10 +00:00
|
|
|
name := resolveTemplateName("conventions", TypeGo)
|
|
|
|
|
require.True(t, name.OK)
|
|
|
|
|
assert.Equal(t, "review", name.Value.(string))
|
2026-03-29 22:35:34 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-29 21:34:46 +00:00
|
|
|
func TestSetup_TemplateExists_Good_Default(t *testing.T) {
|
|
|
|
|
assert.True(t, templateExists("default"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestSetup_TemplateExists_Bad_Missing(t *testing.T) {
|
|
|
|
|
assert.False(t, templateExists("missing-template"))
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-29 22:35:34 +00:00
|
|
|
func TestSetup_TemplateExists_Ugly_Review(t *testing.T) {
|
|
|
|
|
assert.True(t, templateExists("review"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestSetup_DefaultBuildCommand_Good_KnownTypes(t *testing.T) {
|
2026-03-29 21:34:46 +00:00
|
|
|
assert.Equal(t, "go build ./...", defaultBuildCommand(TypeGo))
|
|
|
|
|
assert.Equal(t, "composer test", defaultBuildCommand(TypePHP))
|
|
|
|
|
assert.Equal(t, "npm run build", defaultBuildCommand(TypeNode))
|
2026-03-29 22:35:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestSetup_DefaultBuildCommand_Bad_Unknown(t *testing.T) {
|
2026-03-29 21:34:46 +00:00
|
|
|
assert.Equal(t, "make build", defaultBuildCommand(TypeUnknown))
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-29 22:35:34 +00:00
|
|
|
func TestSetup_DefaultBuildCommand_Ugly_WailsMatchesGo(t *testing.T) {
|
|
|
|
|
assert.Equal(t, defaultBuildCommand(TypeGo), defaultBuildCommand(TypeWails))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestSetup_DefaultTestCommand_Good_KnownTypes(t *testing.T) {
|
2026-03-29 21:34:46 +00:00
|
|
|
assert.Equal(t, "go test ./...", defaultTestCommand(TypeGo))
|
|
|
|
|
assert.Equal(t, "composer test", defaultTestCommand(TypePHP))
|
|
|
|
|
assert.Equal(t, "npm test", defaultTestCommand(TypeNode))
|
2026-03-29 22:35:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestSetup_DefaultTestCommand_Bad_Unknown(t *testing.T) {
|
2026-03-29 21:34:46 +00:00
|
|
|
assert.Equal(t, "make test", defaultTestCommand(TypeUnknown))
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-29 22:35:34 +00:00
|
|
|
func TestSetup_DefaultTestCommand_Ugly_WailsMatchesGo(t *testing.T) {
|
|
|
|
|
assert.Equal(t, defaultTestCommand(TypeGo), defaultTestCommand(TypeWails))
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-29 21:34:46 +00:00
|
|
|
func TestSetup_FormatFlow_Good(t *testing.T) {
|
|
|
|
|
goFlow := formatFlow(TypeGo)
|
|
|
|
|
assert.Contains(t, goFlow, "go build ./...")
|
|
|
|
|
assert.Contains(t, goFlow, "go test ./...")
|
|
|
|
|
|
|
|
|
|
phpFlow := formatFlow(TypePHP)
|
|
|
|
|
assert.Contains(t, phpFlow, "composer test")
|
|
|
|
|
|
|
|
|
|
nodeFlow := formatFlow(TypeNode)
|
|
|
|
|
assert.Contains(t, nodeFlow, "npm run build")
|
|
|
|
|
assert.Contains(t, nodeFlow, "npm test")
|
|
|
|
|
}
|
2026-03-29 22:35:34 +00:00
|
|
|
|
|
|
|
|
func TestSetup_FormatFlow_Bad_Unknown(t *testing.T) {
|
|
|
|
|
flow := formatFlow(TypeUnknown)
|
|
|
|
|
assert.Contains(t, flow, "make build")
|
|
|
|
|
assert.Contains(t, flow, "make test")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestSetup_FormatFlow_Ugly_Wails(t *testing.T) {
|
|
|
|
|
assert.Equal(t, formatFlow(TypeGo), formatFlow(TypeWails))
|
|
|
|
|
}
|