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

Simplify LazyListValue construction in test cases #1479

Merged

Conversation

veyndan
Copy link
Contributor

@veyndan veyndan commented Sep 13, 2023

I want to add more tests to this class, and I don't want to have to keep copy-pasting the construction of LazyListValue when 90% of it will always be the same.

@veyndan veyndan requested a review from JakeWharton September 13, 2023 14:06
items = emptyList(),
)

private fun LazyListValue.copy(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally, this'd be generated within LazyListValue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm guessing we don't want copy to be generated, as it'd need to be part of the public API which we don't want. Though these WidgetValue instances are so far exclusively used in tests, so maybe that doesn't matter?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Test API definitely has more flexibility, although breaking it could still break people.

@veyndan veyndan enabled auto-merge (squash) September 13, 2023 16:30
@veyndan veyndan force-pushed the veyndan/2023-09-13/simplify-LazyListValue-construction branch from 257889a to e00ec0e Compare September 13, 2023 16:32
@veyndan veyndan merged commit b0c4a78 into trunk Sep 13, 2023
8 checks passed
@veyndan veyndan deleted the veyndan/2023-09-13/simplify-LazyListValue-construction branch September 13, 2023 18:07
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.

2 participants