mirror of
https://github.com/cbeuw/Cloak.git
synced 2024-11-07 15:20:40 +00:00
21 lines
654 B
Go
21 lines
654 B
Go
|
package client
|
||
|
|
||
|
import (
|
||
|
"bytes"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestSSVtoJson(t *testing.T) {
|
||
|
ssv := "UID=iGAO85zysIyR4c09CyZSLdNhtP/ckcYu7nIPI082AHA=;PublicKey=IYoUzkle/T/kriE+Ufdm7AHQtIeGnBWbhhlTbmDpUUI=;ServerName=www.bing.com;TicketTimeHint=3600;NumConn=4;MaskBrowser=chrome;"
|
||
|
json := ssvToJson(ssv)
|
||
|
expected := []byte(`{"UID":"iGAO85zysIyR4c09CyZSLdNhtP/ckcYu7nIPI082AHA=","PublicKey":"IYoUzkle/T/kriE+Ufdm7AHQtIeGnBWbhhlTbmDpUUI=","ServerName":"www.bing.com","TicketTimeHint":3600,"NumConn":4,"MaskBrowser":"chrome"}`)
|
||
|
if !bytes.Equal(expected, json) {
|
||
|
t.Error(
|
||
|
"For", "ssvToJson",
|
||
|
"expecting", string(expected),
|
||
|
"got", string(json),
|
||
|
)
|
||
|
}
|
||
|
|
||
|
}
|