open-nomad/tools/missing/main_test.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
442 B
Go
Raw Normal View History

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package main
import (
"testing"
"github.com/shoenig/test/must"
)
func Test_isCoveredOne(t *testing.T) {
try := func(p string, exp bool) {
result := isCoveredOne(p, "foo/bar")
must.Eq(t, exp, result)
}
try("baz", false)
try("foo", false)
try("foo/bar/baz", false)
try("foo/bar", true)
try("foo/bar/...", true)
try("foo/...", true)
try("abc/...", false)
}