Skip to content

Instantly share code, notes, and snippets.

@deankarn
Created May 5, 2017 18:46

Revisions

  1. Dean Karn created this gist May 5, 2017.
    20 changes: 20 additions & 0 deletions dl_test.rs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    extern crate download;

    use std::{io, fs};
    use std::io::{Read, Write};

    #[test]
    fn test_open(){
    let mut file = download::open("http://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz").unwrap();

    println!("{:?}",file);

    let mut f = fs::File::create("/home/joeybloggs/Downloads/download.zip").unwrap();

    println!("{:?}",f);

    let written = io::copy(&mut file,&mut f);

    println!("{:?}, {:?}",file, written);
    assert_eq!(true,true);
    }