move TestPatternParse into stra package && remove incorrect test file

This commit is contained in:
soolaugust 2020-03-26 20:38:02 +08:00
parent 6d42824c2d
commit 7942662d79
2 changed files with 20 additions and 35 deletions

View File

@ -1,35 +0,0 @@
package strategy
import (
"common/scheme"
"fmt"
"testing"
)
func TestGetMyStrategy(t *testing.T) {
fmt.Println("Now Test GetLocalStrategy:")
data, err := getMyStrategy()
if err == nil {
fmt.Println("Result:")
for _, x := range data {
fmt.Printf(" %v\n", x)
}
} else {
fmt.Println("Something Error:")
fmt.Println(err)
}
}
func TestPatternParse(t *testing.T) {
fmt.Println("Now Test PatternParse:")
var a scheme.Strategy
a.Pattern = "test"
parsePattern([]*scheme.Strategy{&a})
fmt.Printf("a.pat:[%s], a.ex[%s]\n", a.Pattern, a.Exclude)
a.Pattern = "```EXCLUDE```test"
parsePattern([]*scheme.Strategy{&a})
fmt.Printf("a.pat:[%s], a.ex[%s]\n", a.Pattern, a.Exclude)
a.Pattern = "test```EXCLUDE```"
parsePattern([]*scheme.Strategy{&a})
fmt.Printf("a.pat:[%s], a.ex[%s]\n", a.Pattern, a.Exclude)
}

View File

@ -0,0 +1,20 @@
package stra
import (
"fmt"
"testing"
)
func TestPatternParse(t *testing.T) {
fmt.Println("Now Test PatternParse:")
var a Strategy
a.Pattern = "test"
parsePattern([]*Strategy{&a})
fmt.Printf("a.pat:[%s], a.ex[%s]\n", a.Pattern, a.Exclude)
a.Pattern = "```EXCLUDE```test"
parsePattern([]*Strategy{&a})
fmt.Printf("a.pat:[%s], a.ex[%s]\n", a.Pattern, a.Exclude)
a.Pattern = "test```EXCLUDE```"
parsePattern([]*Strategy{&a})
fmt.Printf("a.pat:[%s], a.ex[%s]\n", a.Pattern, a.Exclude)
}