mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
change: removeNonAlphanumeric for feed author name
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
|
||||
package uixt
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestVideoCrawler(t *testing.T) {
|
||||
setupAndroid(t)
|
||||
@@ -30,3 +34,20 @@ func TestVideoCrawler(t *testing.T) {
|
||||
err := driverExt.VideoCrawler(configs)
|
||||
checkErr(t, err)
|
||||
}
|
||||
|
||||
func TestRemoveNonAlphanumeric(t *testing.T) {
|
||||
testData := []struct {
|
||||
input string
|
||||
expect string
|
||||
}{
|
||||
{"@Hello 你好123#@!", "Hello你好123"},
|
||||
{"@夏夏在发呆。", "夏夏在发呆"},
|
||||
{"@·霖霖", "霖霖"},
|
||||
{"@我❤️小云朵", "我小云朵"},
|
||||
}
|
||||
|
||||
for _, data := range testData {
|
||||
out := removeNonAlphanumeric(data.input)
|
||||
assert.Equal(t, data.expect, out)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user