-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conversation
Current coverage is 99.73% (diff: 100%)@@ 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
|
@@ -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? { |
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.
@TYRONEMICHAEL Why are we changing this to private?
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.
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
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.
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? { |
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.
Maybe we should consider using CollectionTypes rather than Sequences then?
} | ||
|
||
func testPipeOperatorShouldPipeMultipleFunctions() { | ||
let pipe = testData |
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.
I really like this, looks good 👍
@JustinGuedes fixed this. So we should merge this in? |
@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.