tailscale/version/updates/updates_test.go
Brad Fitzpatrick d39e972e59 version/updates: start of version updates policy package
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-09-29 12:21:27 -07:00

29 lines
523 B
Go

// Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package updates
import (
"bytes"
"os"
"testing"
"github.com/tailscale/hujson"
)
func TestParse(t *testing.T) {
rulesJSON, err := os.ReadFile("rules.json")
if err != nil {
t.Fatal(err)
}
d := hujson.NewDecoder(bytes.NewReader(rulesJSON))
d.DisallowUnknownFields()
var p Policy
if err := d.Decode(&p); err != nil {
t.Fatal(err)
}
}