Amber icon indicating copy to clipboard operation
Amber copied to clipboard

Add basic unit tests

Open FedericoCeratto opened this issue 1 year ago • 6 comments

This change adds basic unit tests and a test harness that compiles code and compare its with an expected value. If any difference is found the test fail and show a friendly diff and the generated code.

FedericoCeratto avatar Jun 24 '24 22:06 FedericoCeratto

Isn't this accomplishing the same job as the end to end tests we had before?

Ph0enixKM avatar Jul 01 '24 13:07 Ph0enixKM

@Ph0enixKM these are unit tests (instead of integration tests). The purpose is to (quickly) test the exact generated output.

FedericoCeratto avatar Jul 01 '24 18:07 FedericoCeratto

@FedericoCeratto I know what these do but what's the practical difference? Oh... instead of testing result we test the resulting bash code. But then we'd have to modify a lot of tests since we'll be now working on making the bash look more readable

Ph0enixKM avatar Jul 01 '24 20:07 Ph0enixKM

@Ph0enixKM Yes, the tests are meant to capture the generated shellscript and reflect improvements in readability. More importantly they would detect any unexpected change in the script layout. The amount of tests should remain very modest.

FedericoCeratto avatar Jul 02 '24 07:07 FedericoCeratto

@FedericoCeratto can you check this PR?

Mte90 avatar Jul 09 '24 09:07 Mte90

@FedericoCeratto just a ping

Mte90 avatar Jul 16 '24 12:07 Mte90

@FedericoCeratto @amber-lang/trusted-maintainers I'll close this PR for now so that it does not take space in open PR list. We can always reopen it

Ph0enixKM avatar Nov 20 '24 11:11 Ph0enixKM