-
Notifications
You must be signed in to change notification settings - Fork 385
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
Edge cases for deriving the singular data class name from table names that are plural #2700
Edge cases for deriving the singular data class name from table names that are plural #2700
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍 The changes look good to me, but it would be nice to have tests for them. Tests like these could be expanded to verify the table.nameOfRowClass
for these cases:
drift/drift_dev/test/analysis/resolver/dart/table_test.dart
Lines 118 to 125 in ddc864a
test('use overridden name', () async { | |
final result = await findTable('TableWithCustomName'); | |
final table = result!.result as DriftTable; | |
expect(result.errorsDuringAnalysis, isEmpty); | |
expect(table.schemaName, 'my-fancy-table'); | |
expect(table.withoutRowId, isTrue); | |
}); |
I agree. I will add some test cases. |
Let me know if you need any help with the tests cases :) |
I got caught up with some other things. I have updated my PR with some test cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tests! Let's avoid the duplicate, but apart from that this looks good.
Complete todo with covering edge cases in deriving the singular data class name from a plural table name