// MustLoadConfigForTests is a variant of LoadConfigForTests which calls
// t.Fatal (or similar) if there are any errors during loading, and thus
// does not return diagnostics at all.
//
// This is useful for concisely writing tests that don't expect errors at
// all. For tests that expect errors and need to assert against them, use
// LoadConfigForTests instead.
MustLoadConfigForTests is a variant of LoadConfigForTests which calls
t.Fatal (or similar) if there are any errors during loading, and thus
does not return diagnostics at all.

This is useful for concisely writing tests that don't expect errors at
all. For tests that expect errors and need to assert against them, use
LoadConfigForTests instead.
// MustLoadConfigForTests is a variant of LoadConfigForTests which calls // t . Fatal ( or similar ) if there are any errors during loading and thus // does not return diagnostics at all . // // This is useful for concisely writing tests that don ' t expect errors at // all . For tests that expect errors and need to assert against them use // LoadConfigForTests instead .
func MustLoadConfigForTests(t *testing.T, rootDir string) (*configs.Config, *configload.Loader, func()) {
	t.Helper()
	config, loader, cleanup, diags := LoadConfigForTests(t, rootDir)
	if diags.HasErrors() {
		cleanup()
		t.Fatal(diags.Err())
	}
	return config, loader, cleanup
}
func MustLoadConfigForTests ( t * testing . T , rootDir string ) ( * configs . Config , * configload . Loader , func ( ) ) { t . Helper ( ) config , loader , cleanup , diags := LoadConfigForTests ( t , rootDir ) if diags . HasErrors ( ) { cleanup ( ) t . Fatal ( diags . Err ( ) ) } return config , loader , cleanup }
MustLoadConfigForTests is a variant of LoadConfigForTests which calls
t.Fatal (or similar) if there are any errors during loading, and thus
does not return diagnostics at all.
MustLoadConfigForTests is a variant of LoadConfigForTests which calls t . Fatal ( or similar ) if there are any errors during loading and thus does not return diagnostics at all .