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 tests for generated tuple/product aggregators #585

Merged
merged 2 commits into from Nov 29, 2016

Conversation

sritchie
Copy link
Collaborator

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.

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})]"]
Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

@codecov-io
Copy link

codecov-io commented Nov 29, 2016

Current coverage is 72.90% (diff: 100%)

Merging #585 into develop will increase coverage by 8.49%

@@            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          

Powered by Codecov. Last update c91e1fb...e56c6e2

@sritchie sritchie added this to the 0.13.0 milestone Nov 29, 2016
Copy link
Collaborator

@johnynek johnynek left a 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})]"]
Copy link
Collaborator

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.

@johnynek johnynek merged commit 10ee2c0 into develop Nov 29, 2016
@johnynek johnynek deleted the sritchie/test_tuple_generators branch November 29, 2016 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants