Files
tasks/tools/tdbg/util_test.go
zeekay 5a601d081b rebrand: go.temporal.io/server -> github.com/hanzoai/tasks
Full module path rebrand from Temporal to Hanzo Tasks:
- go.mod module: github.com/hanzoai/tasks
- All internal Go imports updated (1906 files)
- cmd/server renamed to cmd/tasksd
- Binary name: tasksd (was temporal-server)
- Docker images: hanzoai/tasks (was temporalio/server)
- README rewritten with Hanzo Tasks branding
- LLM.md created with integration notes
- Makefile, goreleaser, CI workflows updated
- go.temporal.io/sdk and go.temporal.io/api imports preserved (separate repos)

Fork of Temporal.io (MIT license).
2026-03-19 10:36:40 -07:00

51 lines
1.1 KiB
Go

package tdbg_test
import "github.com/hanzoai/tasks/tools/tdbg"
func (s *utilSuite) TestStringToEnum_MapCaseInsensitive() {
enumValues := map[string]int32{
"Unspecified": 0,
"Transfer": 1,
"Timer": 2,
"Replication": 3,
}
result, err := tdbg.StringToEnum("timeR", enumValues)
s.NoError(err)
s.Equal(result, int32(2)) // Timer
}
func (s *utilSuite) TestStringToEnum_MapNonExisting() {
enumValues := map[string]int32{
"Unspecified": 0,
"Transfer": 1,
"Timer": 2,
"Replication": 3,
}
result, err := tdbg.StringToEnum("Timer2", enumValues)
s.Error(err)
s.Equal(result, int32(0))
}
func (s *utilSuite) TestStringToEnum_MapEmptyValue() {
enumValues := map[string]int32{
"Unspecified": 0,
"Transfer": 1,
"Timer": 2,
"Replication": 3,
}
result, err := tdbg.StringToEnum("", enumValues)
s.NoError(err)
s.Equal(result, int32(0))
}
func (s *utilSuite) TestStringToEnum_MapEmptyEnum() {
enumValues := map[string]int32{}
result, err := tdbg.StringToEnum("Timer", enumValues)
s.Error(err)
s.Equal(result, int32(0))
}