File tree 3 files changed +28
-2
lines changed
3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ script:
128
128
- export JULIA_CPU_CORES=2 && export JULIA_TEST_MAXRSS_MB=600 &&
129
129
cd /tmp/julia/share/julia/test &&
130
130
/tmp/julia/bin/julia --check-bounds=yes runtests.jl $TESTSTORUN &&
131
- /tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online pkg
131
+ /tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online download pkg
132
132
- cd `dirname $TRAVIS_BUILD_DIR` && mv julia2 julia &&
133
133
rm -f julia/deps/scratch/libgit2-*/CMakeFiles/CMakeOutput.log
134
134
# uncomment the following if failures are suspected to be due to the out-of-memory killer
Original file line number Diff line number Diff line change @@ -56,4 +56,4 @@ test_script:
56
56
- usr\bin\julia -e "versioninfo()"
57
57
- usr\bin\julia --precompiled=no -e "true"
58
58
- cd test && ..\usr\bin\julia --check-bounds=yes runtests.jl all &&
59
- ..\usr\bin\julia --check-bounds=yes runtests.jl libgit2-online pkg
59
+ ..\usr\bin\julia --check-bounds=yes runtests.jl libgit2-online download pkg
Original file line number Diff line number Diff line change
1
+ # This file is a part of Julia. License is MIT: http://julialang.org/license
2
+
3
+ mktempdir () do temp_dir
4
+ # Download a file
5
+ file = joinpath (temp_dir, " ip" )
6
+ @test download (" http://httpbin.org/ip" , file) == file
7
+ @test isfile (file)
8
+ @test ! isempty (read (file))
9
+
10
+ # Download an empty file
11
+ empty_file = joinpath (temp_dir, " empty" )
12
+ @test download (" http://httpbin.org/status/200" , empty_file) == empty_file
13
+
14
+ # Windows and older versions of curl do not create the empty file (https://github.com/curl/curl/issues/183)
15
+ @test ! isfile (empty_file) || isempty (read (empty_file))
16
+
17
+ # Make sure that failed downloads do not leave files around
18
+ missing_file = joinpath (temp_dir, " missing" )
19
+ @test_throws ErrorException download (" http://httpbin.org/status/404" , missing_file)
20
+ @test ! isfile (missing_file)
21
+
22
+ # Use a TEST-NET (192.0.2.0/24) address which shouldn't be bound
23
+ invalid_host_file = joinpath (temp_dir, " invalid_host" )
24
+ @test_throws ErrorException download (" http://192.0.2.1" , invalid_host_file)
25
+ @test ! isfile (invalid_host_file)
26
+ end
You can’t perform that action at this time.
0 commit comments