Two problems we maybe care about:
- How do we know that the command fixture test inputs are valid programs?
- How do we know that the output valid and equivalent to the input?
Proposed solution:
- Every input includes an assertion.
- The test runner compiles and runs the input, to ensure that the input is valid and does what we think.
- The test runner compiles and runs the actual result, to ensure that the results is valid and does the same thing
For example, for rename the input program might look like:
const x = 42;
expect(x).toBe(42);
Two problems we maybe care about:
Proposed solution:
For example, for rename the input program might look like: