-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to create test for non-empty constraint on listing #461
Comments
I think everything works as expected here. (
Here is a more robust test that doesn’t depend on the exact error message:
|
This is because there isn't. Where you say
Actually; that's not as expected. This is a known bug. |
The intention here is to create a test for checking a non-empty constraint on a listing, for regression purposes. I realize that
pkl test
has not been documented, so it's quite possible there are some misunderstandings or unsupported functionality being used here.We need three files for a demonstration.
We can clearly see that
values
defined inNonEmptyImpl
is invalid, as the listing is required to not be empty. However, when running this test:The error seems to suggest that there is no evaluation error here. If that's the case, we should be able to try the inverse test, as demonstrated in NonEmptyTest-Inv.pkl:
This time we get the opposite error instead; an error was thrown and we did not catch it:
If we instead embed this list inside a mapping, this works as expected:
The above has been tested using the following versions:
Pkl 0.25.3 (Linux 5.15.0-1053-aws, native)
Pkl 0.26.0-dev+3a31188 (Linux 5.4.0-177-generic, native)
The text was updated successfully, but these errors were encountered: