Skip to content

Commit 917c4a2

Browse files
committed
file matchers
1 parent a9461fa commit 917c4a2

File tree

2 files changed

+108
-194
lines changed

2 files changed

+108
-194
lines changed

internal/configs/parser_config_dir_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"io/ioutil"
99
"os"
1010
"path/filepath"
11+
"strings"
1112
"testing"
1213

1314
"github.com/hashicorp/hcl/v2"
@@ -236,7 +237,7 @@ func TestParserLoadTestFiles_Invalid(t *testing.T) {
236237

237238
func TestParserLoadConfigDirWithTests_ReturnsWarnings(t *testing.T) {
238239
parser := NewParser(nil)
239-
mod, diags := parser.LoadConfigDir("testdata/valid-modules/with-tests", WithTestFiles("not_real"))
240+
mod, diags := parser.LoadConfigDirWithTests("testdata/valid-modules/with-tests", "not_real")
240241
if len(diags) != 1 {
241242
t.Errorf("expected exactly 1 diagnostic, but found %d", len(diags))
242243
} else {
@@ -248,7 +249,7 @@ func TestParserLoadConfigDirWithTests_ReturnsWarnings(t *testing.T) {
248249
t.Errorf("expected summary to be \"Test directory does not exist\" but was \"%s\"", diags[0].Summary)
249250
}
250251

251-
if diags[0].Detail != "Requested test directory testdata/valid-modules/with-tests/not_real does not exist." {
252+
if !strings.HasPrefix(diags[0].Detail, "Requested test directory testdata/valid-modules/with-tests/not_real does not exist.") {
252253
t.Errorf("expected detail to be \"Requested test directory testdata/valid-modules/with-tests/not_real does not exist.\" but was \"%s\"", diags[0].Detail)
253254
}
254255
}

0 commit comments

Comments
 (0)