Skip to content

v1.1.1

Choose a tag to compare

@maxgreen01 maxgreen01 released this 22 Jul 01:33
· 51 commits to main since this release

This version improves on the Analyze command by representing table-driven tests in more detail as part of each TestCase! This version also improves the command's output report, which includes these new analysis results! The new analysis results are also saved in the JSON file generated for each test.

For the sake of clarity, note that a “test” or “test case” refers to a single test function, as defined by Go’s testing package documentation. In the case of a table-driven test, a “scenario” is an individual entry (aka row) in the table, and represents a single set of input and output data.

What's Changed

✨ New Features

  • Add CSV output report for Analyze command, which includes a condensed version of every analyzed test case
  • Represent the structure of table-driven tests more accurately using the new ScenarioSet struct
    • ScenarioSet also holds analysis results related to table-driven tests, including:
      • The name of the field representing each scenario's name
      • The names of the fields representing the expected results of each scenario
      • Whether the scenario type has any fields whose type is a function
      • Whether the test defines subtests using t.Run() inside the loop body
    • Individual scenarios are stored in the ScenarioSet.Scenarios field
  • Integrate go/types into TestCase to better detect and analyze Scenario data using a completely overhauled Analyze() method that can resolve identifiers

🐛 Bug Fixes

  • JSON reports created by the Analyze command are now saved in the same directory as the specified output file

🛠️ Internal Improvements

  • Create ParserCommand interface to represent both parser.Task and flags.Commander
  • Use init() with to dynamically register parser commands
  • Add methods to easily export TestCase to CSV

📝 Maintenance

  • Upgrade to Go 1.24.5

Full Changelog: v1.1.0...v1.1.1