Skip to content
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

Add 'default' value in case of presence of a variable #291

Merged
merged 1 commit into from Jul 27, 2022

Conversation

ulyssessouza
Copy link
Contributor

No description provided.

Copy link
Member

@milas milas left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -113,6 +113,42 @@ func TestEmptyValueWithHardDefault(t *testing.T) {
assert.Check(t, is.Equal("ok ", result))
}

func TestPrensentValueWithUnset(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

FYI you've got a typo on "Present" here (Prensent) which is copy-pasted to the other test cases too 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ops! My bad!
Good catch!

Comment on lines +192 to +193
template: "ok ${BAR+$FOO ${FOO:+second}}",
expected: "ok first second",
Copy link
Member

Choose a reason for hiding this comment

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

Omg 😵

(nice test case, env var substitution just makes my head hurt 😂)

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
@ulyssessouza ulyssessouza merged commit a317b17 into master Jul 27, 2022
@ulyssessouza ulyssessouza deleted the add-presence-var-default branch July 27, 2022 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants