-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from oxinabox/ox/seven
Remove 0.7 deprecations from tests
- Loading branch information
Showing
3 changed files
with
33 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,8 @@ os: | |
- linux | ||
- osx | ||
julia: | ||
- 0.3 | ||
- 0.4 | ||
- 0.5 | ||
- 0.6 | ||
- 0.7 | ||
- 1.0 | ||
- nightly | ||
notifications: | ||
email: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,37 @@ | ||
using Test | ||
using Pipe | ||
using Test | ||
_macroexpand(x) = macroexpand(Main, x) | ||
|
||
import Base: macroexpand | ||
macroexpand(q) = macroexpand(Main, q) | ||
|
||
#No change to nonpipes functionality | ||
@test macroexpand( :(@pipe a) ) == :a #doesn't change single inputs | ||
@test macroexpand( :(@pipe b(a)) ) == :(b(a)) #doesn't change inputs that a function applications | ||
#No change to nonpipes functionality | ||
@test _macroexpand( :(@pipe a) ) == :a #doesn't change single inputs | ||
@test _macroexpand( :(@pipe b(a)) ) == :(b(a)) #doesn't change inputs that a function applications | ||
|
||
#Compatable with Julia 1.3 piping functionality | ||
@test macroexpand( :(@pipe a|>b) ) == :(b(a)) #basic | ||
@test macroexpand( :(@pipe a|>b|>c) ) == :(c(b(a))) #Keeps chaining 3 | ||
@test macroexpand( :(@pipe a|>b|>c|>d) ) == :(d(c(b(a)))) #Keeps chaining 4 | ||
#Compatable with Julia 0.3 piping functionality | ||
@test _macroexpand( :(@pipe a|>b) ) == :(b(a)) #basic | ||
@test _macroexpand( :(@pipe a|>b|>c) ) == :(c(b(a))) #Keeps chaining 3 | ||
@test _macroexpand( :(@pipe a|>b|>c|>d) ) == :(d(c(b(a)))) #Keeps chaining 4 | ||
|
||
@test macroexpand( :(@pipe a|>b(x)) ) == :((b(x))(a)) #applying to function calls returning functions | ||
@test macroexpand( :(@pipe a(x)|>b ) ) == :(b(a(x))) #feeding functioncall results on wards | ||
@test _macroexpand( :(@pipe a|>b(x)) ) == :((b(x))(a)) #applying to function calls returning functions | ||
@test _macroexpand( :(@pipe a(x)|>b ) ) == :(b(a(x))) #feeding functioncall results on wards | ||
|
||
@test macroexpand(:(@pipe 1|>a)) ==:(a(1)) #Works with literals (int) | ||
@test macroexpand(:(@pipe "foo"|>a)) == :(a("foo")) #Works with literal (string) | ||
@test macroexpand( :(@pipe a|>bb[2])) == :((bb[2])(a)) #Should work with RHS that is a array reference | ||
@test _macroexpand(:(@pipe 1|>a)) ==:(a(1)) #Works with literals (int) | ||
@test _macroexpand(:(@pipe "foo"|>a)) == :(a("foo")) #Works with literal (string) | ||
@test _macroexpand( :(@pipe a|>bb[2])) == :((bb[2])(a)) #Should work with RHS that is a array reference | ||
|
||
|
||
#Marked locations | ||
@test macroexpand( :(@pipe a|>b(_) ) ) == :(b(a)) #Marked location only | ||
@test macroexpand( :(@pipe a|>b(x,_) ) ) == :(b(x,a)) # marked 2nd (and last) | ||
@test macroexpand( :(@pipe a|>b(_,x) ) ) == :(b(a,x)) # marked first | ||
@test macroexpand( :(@pipe a|>b(_,_) ) ) == :(b(a,a)) # marked double (Not certain if this is a good idea) | ||
@test macroexpand( :(@pipe a|>bb[2](x,_))) == :((bb[2])(x,a)) #Should work with RHS that is a array reference | ||
@test _macroexpand( :(@pipe a|>b(_) ) ) == :(b(a)) #Marked location only | ||
@test _macroexpand( :(@pipe a|>b(x,_) ) ) == :(b(x,a)) # marked 2nd (and last) | ||
@test _macroexpand( :(@pipe a|>b(_,x) ) ) == :(b(a,x)) # marked first | ||
@test _macroexpand( :(@pipe a|>b(_,_) ) ) == :(b(a,a)) # marked double (Not certain if this is a good idea) | ||
@test _macroexpand( :(@pipe a|>bb[2](x,_))) == :((bb[2])(x,a)) #Should work with RHS that is a array reference | ||
|
||
#marked Unpacking | ||
@test macroexpand( :(@pipe a|>b(_...) ) ) == :(b(a...)) # Unpacking | ||
@test macroexpand( :(@pipe a|>bb[2](_...))) == :((bb[2])(a...)) #Should work with RHS of arry ref and do unpacking | ||
@test _macroexpand( :(@pipe a|>b(_...) ) ) == :(b(a...)) # Unpacking | ||
@test _macroexpand( :(@pipe a|>bb[2](_...))) == :((bb[2])(a...)) #Should work with RHS of arry ref and do unpacking | ||
|
||
#Mixing modes | ||
@test macroexpand( :(@pipe a|>b|>c(_) ) ) == :(c(b(a))) | ||
@test macroexpand( :(@pipe a|>b(x,_)|>c|>d(_,y) ) ) == :(d(c(b(x,a)),y)) | ||
@test macroexpand( :(@pipe a|>b(xb,_)|>c|>d(_,xd)|>e(xe) |>f(xf,_,yf) ) ) == :(f(xf,(e(xe))(d(c(b(xb,a)),xd)),yf)) #Very Complex | ||
@test _macroexpand( :(@pipe a|>b|>c(_) ) ) == :(c(b(a))) | ||
@test _macroexpand( :(@pipe a|>b(x,_)|>c|>d(_,y) ) ) == :(d(c(b(x,a)),y)) | ||
@test _macroexpand( :(@pipe a|>b(xb,_)|>c|>d(_,xd)|>e(xe) |>f(xf,_,yf) ) ) == :(f(xf,(e(xe))(d(c(b(xb,a)),xd)),yf)) #Very Complex |