Skip to content

Commit

Permalink
Removed checks on sketch.json (now deprecated)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Oct 1, 2024
1 parent f4e8a75 commit 8555811
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 32 deletions.
25 changes: 12 additions & 13 deletions internal/rule/rulefunction/sketch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,21 @@ type sketchRuleFunctionTestTable struct {

func checkSketchRuleFunction(ruleFunction Type, testTables []sketchRuleFunctionTestTable, t *testing.T) {
for _, testTable := range testTables {
expectedOutputRegexp := regexp.MustCompile(testTable.expectedOutputQuery)
t.Run(testTable.testName, func(t *testing.T) {
expectedOutputRegexp := regexp.MustCompile(testTable.expectedOutputQuery)

testProject := project.Type{
Path: sketchesTestDataPath.Join(testTable.sketchFolderName),
ProjectType: projecttype.Sketch,
SuperprojectType: projecttype.Sketch,
}
testProject := project.Type{
Path: sketchesTestDataPath.Join(testTable.sketchFolderName),
ProjectType: projecttype.Sketch,
SuperprojectType: projecttype.Sketch,
}

projectdata.Initialize(testProject)
projectdata.Initialize(testProject)

result, output := ruleFunction()
assert.Equal(t, testTable.expectedRuleResult, result, testTable.testName)
assert.True(t, expectedOutputRegexp.MatchString(output), fmt.Sprintf("%s (output: %s, assertion regex: %s)", testTable.testName, output, testTable.expectedOutputQuery))
result, output := ruleFunction()
assert.Equal(t, testTable.expectedRuleResult, result, testTable.testName)
assert.True(t, expectedOutputRegexp.MatchString(output), fmt.Sprintf("%s (output: %s, assertion regex: %s)", testTable.testName, output, testTable.expectedOutputQuery))
})
}
}

Expand Down Expand Up @@ -112,7 +114,6 @@ func TestSketchDotJSONJSONFormat(t *testing.T) {
testTables := []sketchRuleFunctionTestTable{
{"No metadata file", "NoMetadataFile", ruleresult.Skip, ""},
{"Valid", "ValidMetadataFile", ruleresult.Pass, ""},
{"Invalid", "InvalidJSONMetadataFile", ruleresult.Fail, ""},
}

checkSketchRuleFunction(SketchDotJSONJSONFormat, testTables, t)
Expand All @@ -122,8 +123,6 @@ func TestSketchDotJSONFormat(t *testing.T) {
testTables := []sketchRuleFunctionTestTable{
{"No metadata file", "NoMetadataFile", ruleresult.Skip, ""},
{"Valid", "ValidMetadataFile", ruleresult.Pass, ""},
{"Invalid JSON", "InvalidJSONMetadataFile", ruleresult.Fail, ""},
{"Invalid data", "InvalidDataMetadataFile", ruleresult.Fail, ""},
}

checkSketchRuleFunction(SketchDotJSONFormat, testTables, t)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 8555811

Please sign in to comment.