hedy icon indicating copy to clipboard operation
hedy copied to clipboard

[BUG] Write a test for incorrect keyword placeholders

Open TiBiBa opened this issue 2 years ago • 4 comments

Describe the bug When parsing the keywords dynamically a few error occurs. Would be nice to fix these. In addition to this, it might be nice to crash the tests on these issues? They shouldn't be possible to exist on main in the first place. The following error is thrown as output:

There is an issue due to a non-existing key in the following line:
`{slaap}` laat Hedy voor een (paar) seconde(n) pauzeren.
There is an issue due to a non-existing key in the following line:
`{Add}` iets `{to_list}` een lijst.
There is an issue due to an empty placeholder in the following line:
We kunnen dus een `{while}` loop gebruiken met `{!=}`.

TiBiBa avatar Sep 28 '22 13:09 TiBiBa

Describe the bug When parsing the keywords dynamically a few error occurs. Would be nice to fix these. In addition to this, it might be nice to crash the tests on these issues? They shouldn't be possible to exist on main in the first place. The following error is thrown as output:

There is an issue due to a non-existing key in the following line:
`{slaap}` laat Hedy voor een (paar) seconde(n) pauzeren.
There is an issue due to a non-existing key in the following line:
`{Add}` iets `{to_list}` een lijst.
There is an issue due to an empty placeholder in the following line:
We kunnen dus een `{while}` loop gebruiken met `{!=}`.

Ah good catch!! We are only seeing this now on main since we run the generation on commit since #3333! I agree this should be a failing test instead of an output! We can either copy this code to the unit tests (more clear but a bit more work) or maybe just throw an assert in the generation instead of a print?

Felienne avatar Sep 28 '22 15:09 Felienne

Describe the bug When parsing the keywords dynamically a few error occurs. Would be nice to fix these. In addition to this, it might be nice to crash the tests on these issues? They shouldn't be possible to exist on main in the first place. The following error is thrown as output:

There is an issue due to a non-existing key in the following line:
`{slaap}` laat Hedy voor een (paar) seconde(n) pauzeren.
There is an issue due to a non-existing key in the following line:
`{Add}` iets `{to_list}` een lijst.
There is an issue due to an empty placeholder in the following line:
We kunnen dus een `{while}` loop gebruiken met `{!=}`.

Ah good catch!! We are only seeing this now on main since we run the generation on commit since #3333! I agree this should be a failing test instead of an output! We can either copy this code to the unit tests (more clear but a bit more work) or maybe just throw an assert in the generation instead of a print?

I will look into adding this to the unit tests. Downside is that it will even further increase the time it takes to run these.

TiBiBa avatar Sep 29 '22 05:09 TiBiBa

I will look into adding this to the unit tests.

Thanks!!

Downside is that it will even further increase the time it takes to run these.

Yeah that is true but incorrect example code is shitty for students too!

Felienne avatar Sep 29 '22 11:09 Felienne

https://github.com/Felienne/hedy/pull/3358 fixes the concrete issues mentioned here, but I rewrite this issue to write tests so this cannot occur again

Felienne avatar Sep 30 '22 18:09 Felienne

yaml-validator now does this!

Felienne avatar Feb 07 '24 14:02 Felienne