Files
nomad/tools/missing/main_test.go
Michael Schurter c4ae91f8be Fix WorkloadIdentity.TTL handling, jobspec2 testing, and hcl1 vs 2 parsing (#19024)
* make the little dots consistent
* don't trim delimiter as that over matches
* test jobspec2 package
* copy api/WorkloadIdentity.TTL -> structs
* test ttl parsing
* fix hcl1 v 2 parsing mismatch
* make jobspec(1) tests match jobspec2 tests
2023-11-08 09:01:16 -08:00

28 lines
507 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package main
import (
"testing"
"github.com/shoenig/test/must"
)
func Test_isCoveredOne(t *testing.T) {
try := func(p string, exp bool) {
t.Run(p, func(t *testing.T) {
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/b/...", false)
try("foo/...", true)
try("abc/...", false)
}