mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-03 03:56:04 +00:00
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).
35 lines
869 B
Go
35 lines
869 B
Go
package util_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"github.com/hanzoai/tasks/common/util"
|
|
)
|
|
|
|
func TestWildCardStringToRegexp(t *testing.T) {
|
|
re, err := util.WildCardStringToRegexp("a*z")
|
|
require.NoError(t, err)
|
|
require.Regexp(t, re, "az")
|
|
require.Regexp(t, re, "abz")
|
|
require.NotRegexp(t, re, "ab")
|
|
|
|
_, err = util.WildCardStringToRegexp("")
|
|
require.ErrorContains(t, err, "pattern cannot be empty")
|
|
}
|
|
|
|
func TestWildCardStringsToRegexp(t *testing.T) {
|
|
re, err := util.WildCardStringsToRegexp([]string{"a*z", "b*d"})
|
|
require.NoError(t, err)
|
|
require.Regexp(t, re, "az")
|
|
require.Regexp(t, re, "abz")
|
|
require.NotRegexp(t, re, "ab")
|
|
require.Regexp(t, re, "bd")
|
|
require.Regexp(t, re, "bcd")
|
|
require.NotRegexp(t, re, "bc")
|
|
|
|
re, err = util.WildCardStringsToRegexp([]string{})
|
|
require.NoError(t, err)
|
|
require.NotRegexp(t, re, "a")
|
|
}
|