Skip to content

Add tests for pipe extension #13

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

Merged
merged 3 commits into from
Oct 12, 2016
Merged

Add tests for pipe extension #13

merged 3 commits into from
Oct 12, 2016

Conversation

TYRONEMICHAEL
Copy link
Member

@JustinGuedes I had to change the signature of find to take an array as opposed to a sequence type. I just could not get find to work as a curried function otherwise. Check pipe tests for an example. Maybe I am doing something wrong. Coverage will also be down until this is merged in.

screen shot 2016-10-08 at 11 23 50 am

screen shot 2016-10-08 at 11 24 01 am

@codecov-io
Copy link

codecov-io commented Oct 8, 2016

Current coverage is 99.73% (diff: 100%)

Merging #13 into master will increase coverage by 3.29%

@@             master        #13   diff @@
==========================================
  Files            93         93          
  Lines           759        759          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            732        757    +25   
+ Misses           27          2    -25   
  Partials          0          0          

Powered by Codecov. Last update 1ce8949...6ad6738

@@ -20,7 +20,7 @@ extension R {

*/

public class func find<A, B: SequenceType where A == B.Generator.Element>(predicate: (A) -> Bool, in sequence: B) -> A? {
private class func find<A>(predicate: (A) -> Bool, in sequence: [A]) -> A? {
Copy link
Member

Choose a reason for hiding this comment

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

@TYRONEMICHAEL Why are we changing this to private?

Copy link
Member

Choose a reason for hiding this comment

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

Also not sure why we have to change it to an array, maybe you can show me because those images should fail because of the ambiguity. I'm probably missing something somewhere

Copy link
Member Author

Choose a reason for hiding this comment

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

Jammer man. This should be public. Nice pick up Smith.

@@ -41,7 +41,7 @@ extension R {

*/

public class func find<A, B: SequenceType where A == B.Generator.Element>(predicate: (A) -> Bool) -> (in: B) -> A? {
public class func find<A>(predicate: (A) -> Bool) -> (in: [A]) -> A? {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should consider using CollectionTypes rather than Sequences then?

}

func testPipeOperatorShouldPipeMultipleFunctions() {
let pipe = testData
Copy link
Member

Choose a reason for hiding this comment

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

I really like this, looks good 👍

@TYRONEMICHAEL
Copy link
Member Author

@JustinGuedes fixed this. So we should merge this in?

@TYRONEMICHAEL TYRONEMICHAEL merged commit 4babe07 into master Oct 12, 2016
@TYRONEMICHAEL TYRONEMICHAEL deleted the pipe-tests branch October 12, 2016 16:23
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.

3 participants