assertRender asserts that optimising node produces a result that renders to the expected string.
(t *testing.T, expected string, node ConditionNode, msgAndArgs ...any)
| 53 | // assertRender asserts that optimising node produces a result that renders to |
| 54 | // the expected string. |
| 55 | func assertRender(t *testing.T, expected string, node ConditionNode, msgAndArgs ...any) { |
| 56 | t.Helper() |
| 57 | result := OptimizeExpression(node) |
| 58 | require.NotNil(t, result, "OptimizeExpression returned nil") |
| 59 | assert.Equal(t, expected, result.Render(), msgAndArgs...) |
| 60 | } |
| 61 | |
| 62 | // --------------------------------------------------------------------------- |
| 63 | // Nil / leaf nodes |
no test coverage detected