diff options
Diffstat (limited to 'version/updates/updates_test.go')
| -rw-r--r-- | version/updates/updates_test.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/version/updates/updates_test.go b/version/updates/updates_test.go new file mode 100644 index 000000000..491a3eae1 --- /dev/null +++ b/version/updates/updates_test.go @@ -0,0 +1,28 @@ +// 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) + } +} |
