Skip to content

fix: loop variable captured by func literal in parameters test #5878

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

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

kylecarbs
Copy link
Member

I noticed this when adding a new parameter type. There's a test case for an empty string that returned false for validation, but appears like it could be true.

If there is no value for a string, then the default is used. In this case there is no default, but that's technically fine I believe.

I noticed this when adding a new parameter type. There's a test
case for an empty string that returned false for validation,
but appears like it could be true.

If there is no value for a string, then the default is used.
In this case there is no default, but that's technically fine
I believe.
@kylecarbs kylecarbs requested a review from mtojek January 26, 2023 17:47
@kylecarbs kylecarbs self-assigned this Jan 26, 2023
@@ -900,7 +900,7 @@ func TestWorkspaceBuildValidateRichParameters(t *testing.T) {
{numberParameterName, "10", true, numberRichParameters},
{numberParameterName, "11", false, numberRichParameters},

{stringParameterName, "", false, stringRichParameters},
{stringParameterName, "", true, stringRichParameters},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that what happens here is that the parameter is ignored by API as it's "", hence it doesn't fail.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I see.

@kylecarbs kylecarbs merged commit b20cb99 into main Jan 27, 2023
@kylecarbs kylecarbs deleted the fixparamsvalidation branch January 27, 2023 15:37
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants