@@ -983,29 +983,29 @@ cd(dirwalk) do
983
983
follow_symlink_vec = has_symlinks ? [true , false ] : [false ]
984
984
has_symlinks && symlink (abspath (" sub_dir2" ), joinpath (" sub_dir1" , " link" ))
985
985
for follow_symlinks in follow_symlink_vec
986
- task = walkdir (" ." , follow_symlinks= follow_symlinks)
987
- root, dirs, files = consume (task )
986
+ chnl = walkdir (" ." , follow_symlinks= follow_symlinks)
987
+ root, dirs, files = take! (chnl )
988
988
@test root == " ."
989
989
@test dirs == [" sub_dir1" , " sub_dir2" ]
990
990
@test files == [" file1" , " file2" ]
991
991
992
- root, dirs, files = consume (task )
992
+ root, dirs, files = take! (chnl )
993
993
@test root == joinpath (" ." , " sub_dir1" )
994
994
@test dirs == (has_symlinks ? [" link" , " subsub_dir1" , " subsub_dir2" ] : [" subsub_dir1" , " subsub_dir2" ])
995
995
@test files == [" file1" , " file2" ]
996
996
997
- root, dirs, files = consume (task )
997
+ root, dirs, files = take! (chnl )
998
998
if follow_symlinks
999
999
@test root == joinpath (" ." , " sub_dir1" , " link" )
1000
1000
@test dirs == []
1001
1001
@test files == [" file_dir2" ]
1002
- root, dirs, files = consume (task )
1002
+ root, dirs, files = take! (chnl )
1003
1003
end
1004
1004
for i= 1 : 2
1005
1005
@test root == joinpath (" ." , " sub_dir1" , " subsub_dir$i " )
1006
1006
@test dirs == []
1007
1007
@test files == []
1008
- root, dirs, files = consume (task )
1008
+ root, dirs, files = take! (chnl )
1009
1009
end
1010
1010
1011
1011
@test root == joinpath (" ." , " sub_dir2" )
@@ -1014,51 +1014,51 @@ cd(dirwalk) do
1014
1014
end
1015
1015
1016
1016
for follow_symlinks in follow_symlink_vec
1017
- task = walkdir (" ." , follow_symlinks= follow_symlinks, topdown= false )
1018
- root, dirs, files = consume (task )
1017
+ chnl = walkdir (" ." , follow_symlinks= follow_symlinks, topdown= false )
1018
+ root, dirs, files = take! (chnl )
1019
1019
if follow_symlinks
1020
1020
@test root == joinpath (" ." , " sub_dir1" , " link" )
1021
1021
@test dirs == []
1022
1022
@test files == [" file_dir2" ]
1023
- root, dirs, files = consume (task )
1023
+ root, dirs, files = take! (chnl )
1024
1024
end
1025
1025
for i= 1 : 2
1026
1026
@test root == joinpath (" ." , " sub_dir1" , " subsub_dir$i " )
1027
1027
@test dirs == []
1028
1028
@test files == []
1029
- root, dirs, files = consume (task )
1029
+ root, dirs, files = take! (chnl )
1030
1030
end
1031
1031
@test root == joinpath (" ." , " sub_dir1" )
1032
1032
@test dirs == (has_symlinks ? [" link" , " subsub_dir1" , " subsub_dir2" ] : [" subsub_dir1" , " subsub_dir2" ])
1033
1033
@test files == [" file1" , " file2" ]
1034
1034
1035
- root, dirs, files = consume (task )
1035
+ root, dirs, files = take! (chnl )
1036
1036
@test root == joinpath (" ." , " sub_dir2" )
1037
1037
@test dirs == []
1038
1038
@test files == [" file_dir2" ]
1039
1039
1040
- root, dirs, files = consume (task )
1040
+ root, dirs, files = take! (chnl )
1041
1041
@test root == " ."
1042
1042
@test dirs == [" sub_dir1" , " sub_dir2" ]
1043
1043
@test files == [" file1" , " file2" ]
1044
1044
end
1045
1045
# test of error handling
1046
- task_error = walkdir (" ." )
1047
- task_noerror = walkdir (" ." , onerror= x-> x)
1048
- root, dirs, files = consume (task_error )
1046
+ chnl_error = walkdir (" ." )
1047
+ chnl_noerror = walkdir (" ." , onerror= x-> x)
1048
+ root, dirs, files = take! (chnl_error )
1049
1049
@test root == " ."
1050
1050
@test dirs == [" sub_dir1" , " sub_dir2" ]
1051
1051
@test files == [" file1" , " file2" ]
1052
1052
1053
1053
rm (joinpath (" sub_dir1" ), recursive= true )
1054
- @test_throws SystemError consume (task_error ) # throws an error because sub_dir1 do not exist
1054
+ @test_throws SystemError take! (chnl_error ) # throws an error because sub_dir1 do not exist
1055
1055
1056
- root, dirs, files = consume (task_noerror )
1056
+ root, dirs, files = take! (chnl_noerror )
1057
1057
@test root == " ."
1058
1058
@test dirs == [" sub_dir1" , " sub_dir2" ]
1059
1059
@test files == [" file1" , " file2" ]
1060
1060
1061
- root, dirs, files = consume (task_noerror ) # skips sub_dir1 as it no longer exist
1061
+ root, dirs, files = take! (chnl_noerror ) # skips sub_dir1 as it no longer exist
1062
1062
@test root == joinpath (" ." , " sub_dir2" )
1063
1063
@test dirs == []
1064
1064
@test files == [" file_dir2" ]
@@ -1192,7 +1192,7 @@ let x = rand(3), y = rand(3)
1192
1192
@test @compat (sin .(cos .(x))) == map (x -> sin (cos (x)), x)
1193
1193
@test @compat (atan2 .(sin .(y),x)) == broadcast (atan2,map (sin,y),x)
1194
1194
end
1195
- let x0 = Array ( Float64), v, v0
1195
+ let x0 = Array { Float64} ( ), v, v0
1196
1196
x0[1 ] = rand ()
1197
1197
v0 = @compat sin .(x0)
1198
1198
@test isa (v0, Array{Float64,0 })
0 commit comments