cli/pkg/sdk/sdk_test.go
Snider eaa35fb718 feat(sdk): add SetVersion method for release integration
Add version field to SDK struct and SetVersion method that updates both
the internal version and the config's Package.Version. This enables the
release system to pass version information to SDK generators.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 03:15:08 +00:00

30 lines
589 B
Go

package sdk
import (
"testing"
)
func TestSDK_Good_SetVersion(t *testing.T) {
s := New("/tmp", nil)
s.SetVersion("v1.2.3")
if s.version != "v1.2.3" {
t.Errorf("expected version v1.2.3, got %s", s.version)
}
}
func TestSDK_Good_VersionPassedToGenerator(t *testing.T) {
config := &Config{
Languages: []string{"typescript"},
Output: "sdk",
Package: PackageConfig{
Name: "test-sdk",
},
}
s := New("/tmp", config)
s.SetVersion("v2.0.0")
if s.config.Package.Version != "v2.0.0" {
t.Errorf("expected config version v2.0.0, got %s", s.config.Package.Version)
}
}