@@ -46,19 +46,21 @@ type sketchRuleFunctionTestTable struct {
4646
4747func checkSketchRuleFunction (ruleFunction Type , testTables []sketchRuleFunctionTestTable , t * testing.T ) {
4848 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 )
5051
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+ }
5657
57- projectdata .Initialize (testProject )
58+ projectdata .Initialize (testProject )
5859
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+ })
6264 }
6365}
6466
@@ -112,7 +114,6 @@ func TestSketchDotJSONJSONFormat(t *testing.T) {
112114 testTables := []sketchRuleFunctionTestTable {
113115 {"No metadata file" , "NoMetadataFile" , ruleresult .Skip , "" },
114116 {"Valid" , "ValidMetadataFile" , ruleresult .Pass , "" },
115- {"Invalid" , "InvalidJSONMetadataFile" , ruleresult .Fail , "" },
116117 }
117118
118119 checkSketchRuleFunction (SketchDotJSONJSONFormat , testTables , t )
@@ -122,8 +123,6 @@ func TestSketchDotJSONFormat(t *testing.T) {
122123 testTables := []sketchRuleFunctionTestTable {
123124 {"No metadata file" , "NoMetadataFile" , ruleresult .Skip , "" },
124125 {"Valid" , "ValidMetadataFile" , ruleresult .Pass , "" },
125- {"Invalid JSON" , "InvalidJSONMetadataFile" , ruleresult .Fail , "" },
126- {"Invalid data" , "InvalidDataMetadataFile" , ruleresult .Fail , "" },
127126 }
128127
129128 checkSketchRuleFunction (SketchDotJSONFormat , testTables , t )
0 commit comments