@@ -46,19 +46,21 @@ type sketchRuleFunctionTestTable struct {
46
46
47
47
func checkSketchRuleFunction (ruleFunction Type , testTables []sketchRuleFunctionTestTable , t * testing.T ) {
48
48
for _ , testTable := range testTables {
49
- expectedOutputRegexp := regexp .MustCompile (testTable .expectedOutputQuery )
49
+ t .Run (testTable .testName , func (t * testing.T ) {
50
+ expectedOutputRegexp := regexp .MustCompile (testTable .expectedOutputQuery )
50
51
51
- testProject := project.Type {
52
- Path : sketchesTestDataPath .Join (testTable .sketchFolderName ),
53
- ProjectType : projecttype .Sketch ,
54
- SuperprojectType : projecttype .Sketch ,
55
- }
52
+ testProject := project.Type {
53
+ Path : sketchesTestDataPath .Join (testTable .sketchFolderName ),
54
+ ProjectType : projecttype .Sketch ,
55
+ SuperprojectType : projecttype .Sketch ,
56
+ }
56
57
57
- projectdata .Initialize (testProject )
58
+ projectdata .Initialize (testProject )
58
59
59
- result , output := ruleFunction ()
60
- assert .Equal (t , testTable .expectedRuleResult , result , testTable .testName )
61
- assert .True (t , expectedOutputRegexp .MatchString (output ), fmt .Sprintf ("%s (output: %s, assertion regex: %s)" , testTable .testName , output , testTable .expectedOutputQuery ))
60
+ result , output := ruleFunction ()
61
+ assert .Equal (t , testTable .expectedRuleResult , result , testTable .testName )
62
+ assert .True (t , expectedOutputRegexp .MatchString (output ), fmt .Sprintf ("%s (output: %s, assertion regex: %s)" , testTable .testName , output , testTable .expectedOutputQuery ))
63
+ })
62
64
}
63
65
}
64
66
@@ -112,7 +114,6 @@ func TestSketchDotJSONJSONFormat(t *testing.T) {
112
114
testTables := []sketchRuleFunctionTestTable {
113
115
{"No metadata file" , "NoMetadataFile" , ruleresult .Skip , "" },
114
116
{"Valid" , "ValidMetadataFile" , ruleresult .Pass , "" },
115
- {"Invalid" , "InvalidJSONMetadataFile" , ruleresult .Fail , "" },
116
117
}
117
118
118
119
checkSketchRuleFunction (SketchDotJSONJSONFormat , testTables , t )
@@ -122,8 +123,6 @@ func TestSketchDotJSONFormat(t *testing.T) {
122
123
testTables := []sketchRuleFunctionTestTable {
123
124
{"No metadata file" , "NoMetadataFile" , ruleresult .Skip , "" },
124
125
{"Valid" , "ValidMetadataFile" , ruleresult .Pass , "" },
125
- {"Invalid JSON" , "InvalidJSONMetadataFile" , ruleresult .Fail , "" },
126
- {"Invalid data" , "InvalidDataMetadataFile" , ruleresult .Fail , "" },
127
126
}
128
127
129
128
checkSketchRuleFunction (SketchDotJSONFormat , testTables , t )
0 commit comments