-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreg_test.go
23 lines (19 loc) · 966 Bytes
/
reg_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2021 Hollson. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package gdk
import (
"fmt"
"testing"
)
func TestMatchAny(t *testing.T) {
fmt.Println(MatchAny("golang", "foobarbaz", "hello world", "golang")) // true
fmt.Println(MatchAny("go", "foobarbaz", "hello world", "golang")) // false
fmt.Println(MatchAny("go*", "foobarbaz", "hello world", "golang")) // true
fmt.Println(MatchAny("foo*", "foobarbaz", "hello world", "golang")) // true
fmt.Println(MatchAny("*lang", "foobarbaz", "hello world", "golang")) // true
fmt.Println(MatchAny("foo*baz", "foobarbaz", "hello world", "golang")) // true
fmt.Println(MatchAny("foo*ba", "foobarbaz", "hello world", "golang")) // false
fmt.Println(MatchAny("foo*lang", "foobarbaz", "hello world", "golang")) // false
fmt.Println(MatchAny("&^%$*lang", "foobarbaz", "hello world", "golang")) // false
}