spdx/tools-golang

Streamline testing with testCases and reflect.DeepEquals

lumjjb opened this issue · 0 comments

Currently , each test case is a test on its own and can be collapsed to a single test case with shared test function uses the following golang idiomatic test pattern:

testCases := struct {
   creatorType string
   ...
   expected v2_3.CreationInfo
}{
  ...
}
for _, t := range testCases {
   t.Run(...)
}

In addition, reflect.DeepEquals can be used instead to do cleaner comparisons.