Files
sub2sing-box/test/hysteria_parser_test.go

22 lines
379 B
Go

package test
import (
"encoding/json"
"fmt"
"log"
"testing"
"github.com/sagernet/sing/common/byteformats"
)
func TestUnmarshalNetworkBytesCompact(t *testing.T) {
up := &byteformats.NetworkBytesCompat{}
upmbps := "100 Mbps"
err := json.Unmarshal(fmt.Appendf(nil, `"%s"`, upmbps), up)
if err != nil {
log.Fatalf("error: %v", err)
return
}
log.Printf("%+v", up)
}