Why can public tests have a new line and custom tests can't (ref file)?

Since I struggled a lot with finally getting my custom tests to work I decided to post here with two examples. Here is the ref file of the first public test:
grafik

My code passed the test. Now the ref file from my own test:
grafik

The difference is that the public tests have this extra line and I thought they are the pattern which I should follow. Actually my custom tests worked out, but only if I deleted that extra line. So my question essentially is why is there a difference? (and why didn’t anyone tell me a few hours ago?)

Hey, there should be no difference between public and custom tests. In both cases the output of the test is checked against the ref file char by char. I assume your custom test simply does not print this newline character at the end. If you adjust your custom test such that it also outputs the newline character then it would work the way you had it previously, i.e. with the newline in the .ref file. Note that it might be the case that some public tests contain the newline in the ref file and some do not. Either way, the corresponding assembly file would respect this. So if you always copy both files from the same test and not e.g. the .asm file from test_check_win_1 and the .ref file from another test then you should not have any trouble.

1 Like

Also note that tests/pub/test_check_win_1.ref does not contain a newline at the end. It was probably automatically inserted by an editor in your case.

The issue of automatically inserted newlines and the confusion in tests was discussed here yesterday:

1 Like