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

Fix generation functions with 'set' and 'get' names #82

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

comm1x
Copy link

@comm1x comm1x commented May 11, 2023

The original problem was that FunctionSpecTests.testGenSetFunction() test was failed.

It means you can't generate such code: func set(property: Swift.String) with swift poet. Instead of this you will get set(property) as result.

This PR fix this issue.

@@ -796,4 +797,48 @@ class FunctionSpecTests {
assertThat(testFuncBlder.signature.parameters, hasItems(ParameterSpec.builder("a", STRING).build()))
assertThat(testFuncBlder.body.formatParts, hasItems("val;\n"))
}

@Test
@DisplayName("Generate property with setter and getter")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @comm1x, just verifying, this test fails without your change correct?

@dnkoutso dnkoutso merged commit e134912 into outfoxx:main Dec 15, 2023
@dnkoutso
Copy link
Collaborator

I verified this locally and it works.

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

2 participants