Skip to content

Search backend: clean up TestToTextPatternInfo

Warren Gifford requested to merge cc/clean-up-tests into main

Created by: camdencheek

This does two things:

  1. Removes tests that pass and/or queries to ToTextPatternInfo since we maintain the invariant that only queries with an atomic pattern are ever passed to ToTextPatternInfo
  2. Reformats the test into a table-driven test so that when a test fails, we have a test name to go with it. Previously, it was really difficult to attribute a failure to a specific case, but now a failure will look something like FAIL: TestToTextPatternInfo/107, which includes the test name 107, which is associated with the test case. The autogold auto-update still works. As a bonus, I find this a bit easier to read.

Followup from https://github.com/sourcegraph/sourcegraph/pull/34382/files#r857831263

Test plan

Just updating a test.

Merge request reports

Loading