-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
48 lines (37 loc) · 2.12 KB
/
main_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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestFindServers(t *testing.T) {
sample := `ss://[email protected]:5002
ss://[email protected]:5001#Britain501%20%28t.me/Outline_Vpn%29
Other text
🇬🇧 #Britain
ss://[email protected]:4444#Britain502%20%28t.me/Outline_Vpn%29
Definitely not clean
🇬🇧 #Britain
ss://[email protected]:3306/Outline_Vpn%29
🇬🇧 #Britain
ss://[email protected]:2376#Britain504%20%28t.me
🇬🇧 #Britain
ss://YWVzLTI1Ni1nY206UENubkg2U1FTbmZvUzI3QDUuMzkuNzAuMTM4OjgwOTA=#FrOutlineKeys
ss://YWVzLTI1Ni1nY206S2l4THZLendqZWtHMDBybQ==@ak1394.free.www.outline.network:8080#www.outline.network%20(japan)
vmess://eyJhZGQiOiIxMTYuMjAzLjczLjM0IiwiYWlkIjoiMCIsImFscG4iOiIiLCJob3N0IjoiZ29vZ2xlLmNvbSIsImlkIjoiMmFhYzc3ZGUtYjNlNC00MDE3LTg0NWMtY2ExMzgwZjJlOGQwIiwibmV0Ijoid3MiLCJwYXRoIjoiL3RlbGVncmFtLWlkLUBwcml2YXRldnBucyIsInBvcnQiOiI4MCIsInBzIjoiMTExNyhAT3V0bGluZV9WcG4pIiwic2N5IjoiYXV0byIsInNuaSI6IiIsInRscyI6IiIsInR5cGUiOiIiLCJ2IjoiMiJ9
vless://[email protected]:2376#Britain504%20%28t.me
Страна: 🇳🇱 Нидерланды Срок действия: 3 дня Ключ: ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpUdTFSU2ZyakRoWGREaTlnWUYzeE9k@178.208.91.118:16942/?outline=1
`
expectedServers := []string{
"ss://[email protected]:5002",
"ss://[email protected]:5001",
"ss://[email protected]:4444",
"ss://[email protected]:3306",
"ss://[email protected]:2376",
"ss://YWVzLTI1Ni1nY206UENubkg2U1FTbmZvUzI3QDUuMzkuNzAuMTM4OjgwOTA",
"ss://YWVzLTI1Ni1nY206S2l4THZLendqZWtHMDBybQ==@ak1394.free.www.outline.network:8080",
"ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpUdTFSU2ZyakRoWGREaTlnWUYzeE9k@178.208.91.118:16942",
}
servers := findServers(sample)
assert.Len(t, servers, 8)
assert.EqualValues(t, expectedServers, servers)
}