Skip to content

Commit 9e7df0a

Browse files
committed
Fix end of line
1 parent 9de86a3 commit 9e7df0a

1 file changed

Lines changed: 40 additions & 40 deletions

File tree

pkg/validators/metadata_validators_test.go

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,51 @@
1414
package validators
1515

1616
import (
17-
"hpc-toolkit/pkg/config"
18-
"hpc-toolkit/pkg/modulereader"
19-
"testing"
17+
"hpc-toolkit/pkg/config"
18+
"hpc-toolkit/pkg/modulereader"
19+
"testing"
2020

21-
"github.com/zclconf/go-cty/cty"
21+
"github.com/zclconf/go-cty/cty"
2222
)
2323

2424
func TestRegexValidator(t *testing.T) {
25-
// Fake blueprint for testing
26-
bp := config.Blueprint{
27-
BlueprintName: "test-bp",
28-
Groups: []config.Group{
29-
{
30-
Name: "primary",
31-
Modules: []config.Module{
32-
{
33-
ID: "test-module",
34-
Source: "test/module",
35-
Settings: config.NewDict(map[string]cty.Value{
36-
"name": cty.StringVal("Invalid-Name"),
37-
}),
38-
},
39-
},
40-
},
41-
},
42-
}
25+
// Fake blueprint for testing
26+
bp := config.Blueprint{
27+
BlueprintName: "test-bp",
28+
Groups: []config.Group{
29+
{
30+
Name: "primary",
31+
Modules: []config.Module{
32+
{
33+
ID: "test-module",
34+
Source: "test/module",
35+
Settings: config.NewDict(map[string]cty.Value{
36+
"name": cty.StringVal("Invalid-Name"),
37+
}),
38+
},
39+
},
40+
},
41+
},
42+
}
4343

44-
// Validation rule from metadata.yaml
45-
rule := modulereader.ValidationRule{
46-
Validator: "regex",
47-
ErrorMessage: "'name' must be lowercase and start with a letter.",
48-
Inputs: map[string]interface{}{
49-
"vars": []interface{}{"name"},
50-
"pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$",
51-
},
52-
}
44+
// Validation rule from metadata.yaml
45+
rule := modulereader.ValidationRule{
46+
Validator: "regex",
47+
ErrorMessage: "'name' must be lowercase and start with a letter.",
48+
Inputs: map[string]interface{}{
49+
"vars": []interface{}{"name"},
50+
"pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$",
51+
},
52+
}
5353

54-
validator := RegexValidator{}
55-
err := validator.Validate(bp, bp.Groups[0].Modules[0], rule, bp.Groups[0], 0)
56-
if err == nil {
57-
t.Errorf("Expected validation error, but got nil")
58-
}
54+
validator := RegexValidator{}
55+
err := validator.Validate(bp, bp.Groups[0].Modules[0], rule, bp.Groups[0], 0)
56+
if err == nil {
57+
t.Errorf("Expected validation error, but got nil")
58+
}
5959

60-
expectedError := "deployment_groups[0].modules[0].settings.name: 'name' must be lowercase and start with a letter."
61-
if err.Error() != expectedError {
62-
t.Errorf("Expected error message '%s', but got '%s'", expectedError, err.Error())
63-
}
60+
expectedError := "deployment_groups[0].modules[0].settings.name: 'name' must be lowercase and start with a letter."
61+
if err.Error() != expectedError {
62+
t.Errorf("Expected error message '%s', but got '%s'", expectedError, err.Error())
63+
}
6464
}

0 commit comments

Comments
 (0)