mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
* 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
28 lines
507 B
Go
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)
|
|
}
|