|
@@ -23,6 +23,8 @@ import (
|
|
"github.com/lf-edge/ekuiper/internal/topo/state"
|
|
"github.com/lf-edge/ekuiper/internal/topo/state"
|
|
"github.com/lf-edge/ekuiper/pkg/api"
|
|
"github.com/lf-edge/ekuiper/pkg/api"
|
|
"reflect"
|
|
"reflect"
|
|
|
|
+ "regexp"
|
|
|
|
+ "strings"
|
|
"testing"
|
|
"testing"
|
|
"time"
|
|
"time"
|
|
)
|
|
)
|
|
@@ -105,10 +107,16 @@ func TestCreateAndClose(t *testing.T) {
|
|
)
|
|
)
|
|
for i, topic := range sinkTopics {
|
|
for i, topic := range sinkTopics {
|
|
createPub(topic)
|
|
createPub(topic)
|
|
- r, err := getRegexp(sourceTopics[i])
|
|
|
|
- if err != nil {
|
|
|
|
- t.Error(err)
|
|
|
|
- return
|
|
|
|
|
|
+ var (
|
|
|
|
+ r *regexp.Regexp
|
|
|
|
+ err error
|
|
|
|
+ )
|
|
|
|
+ if strings.ContainsAny(sourceTopics[i], "+#") {
|
|
|
|
+ r, err = getRegexp(sourceTopics[i])
|
|
|
|
+ if err != nil {
|
|
|
|
+ t.Error(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
}
|
|
}
|
|
c := createSub(sourceTopics[i], r, fmt.Sprintf("%d", i))
|
|
c := createSub(sourceTopics[i], r, fmt.Sprintf("%d", i))
|
|
chans = append(chans, c)
|
|
chans = append(chans, c)
|