-
Notifications
You must be signed in to change notification settings - Fork 347
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 tests for generated tuple/product aggregators #585
Conversation
def get_class_definition(n, algebraic_structure) | ||
# Example: "T,U" | ||
type_values_commaed = TYPE_SYMBOLS.first(n).join(", ") | ||
"class Tuple#{n}#{algebraic_structure.capitalize}[#{type_values_commaed}](implicit #{get_type_parameters(n, algebraic_structure)}) extends #{algebraic_structure.capitalize}[(#{type_values_commaed})]" | ||
extends = ["#{algebraic_structure.capitalize}[(#{type_values_commaed})]"] |
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.
everything except for this change is a formatting thing that removes the extra space before :
. Strange that the checked-in script didn't generate the checked-in code, by the way.
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.
What I think it is: code formatting has run on the code.
Current coverage is 72.90% (diff: 100%)@@ develop #585 diff @@
==========================================
Files 111 111
Lines 4572 4425 -147
Methods 4154 4009 -145
Messages 0 0
Branches 379 377 -2
==========================================
+ Hits 2945 3226 +281
+ Misses 1627 1199 -428
Partials 0 0
|
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.
This is so great! Thanks Sam!
def get_class_definition(n, algebraic_structure) | ||
# Example: "T,U" | ||
type_values_commaed = TYPE_SYMBOLS.first(n).join(", ") | ||
"class Tuple#{n}#{algebraic_structure.capitalize}[#{type_values_commaed}](implicit #{get_type_parameters(n, algebraic_structure)}) extends #{algebraic_structure.capitalize}[(#{type_values_commaed})]" | ||
extends = ["#{algebraic_structure.capitalize}[(#{type_values_commaed})]"] |
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.
What I think it is: code formatting has run on the code.
This PR increases our coverage for the worst offenders in
algebird-core
- the generated product and tuple aggregators.I've also modified the generation script so that each data structure extends its parent. This reduces duplication and allows us to test ALL methods with
ringLaws
alone.The inheritance doesn't break binary compatibility.