@@ -33,21 +33,27 @@ func TestCopy(t *testing.T) {
3333 err = Copy ("testdata/input.txt" , "/tmp/offset_is_bigger_then_file_size.txt" , 100000 , 0 )
3434 require .Error (t , err )
3535
36- Copy ("testdata/input.txt" , "/tmp/copy_offset0_limit0.txt" , 0 , 0 )
36+ err = Copy ("testdata/input.txt" , "/tmp/copy_offset0_limit0.txt" , 0 , 0 )
37+ require .NoError (t , err )
3738 require .Equal (t , FileMD5 ("testdata/out_offset0_limit0.txt" ), FileMD5 ("/tmp/copy_offset0_limit0.txt" ))
3839
39- Copy ("testdata/input.txt" , "/tmp/copy_offset0_limit10.txt" , 0 , 10 )
40+ err = Copy ("testdata/input.txt" , "/tmp/copy_offset0_limit10.txt" , 0 , 10 )
41+ require .NoError (t , err )
4042 require .Equal (t , FileMD5 ("testdata/out_offset0_limit10.txt" ), FileMD5 ("/tmp/copy_offset0_limit10.txt" ))
4143
42- Copy ("testdata/input.txt" , "/tmp/copy_offset0_limit1000.txt" , 0 , 1000 )
44+ err = Copy ("testdata/input.txt" , "/tmp/copy_offset0_limit1000.txt" , 0 , 1000 )
45+ require .NoError (t , err )
4346 require .Equal (t , FileMD5 ("testdata/out_offset0_limit1000.txt" ), FileMD5 ("/tmp/copy_offset0_limit1000.txt" ))
4447
45- Copy ("testdata/input.txt" , "/tmp/copy_offset0_limit10000.txt" , 0 , 10000 )
48+ err = Copy ("testdata/input.txt" , "/tmp/copy_offset0_limit10000.txt" , 0 , 10000 )
49+ require .NoError (t , err )
4650 require .Equal (t , FileMD5 ("testdata/out_offset0_limit10000.txt" ), FileMD5 ("/tmp/copy_offset0_limit10000.txt" ))
4751
48- Copy ("testdata/input.txt" , "/tmp/copy_offset100_limit1000.txt" , 100 , 1000 )
52+ err = Copy ("testdata/input.txt" , "/tmp/copy_offset100_limit1000.txt" , 100 , 1000 )
53+ require .NoError (t , err )
4954 require .Equal (t , FileMD5 ("testdata/out_offset100_limit1000.txt" ), FileMD5 ("/tmp/copy_offset100_limit1000.txt" ))
5055
51- Copy ("testdata/input.txt" , "/tmp/copy_offset6000_limit1000.txt" , 6000 , 1000 )
56+ err = Copy ("testdata/input.txt" , "/tmp/copy_offset6000_limit1000.txt" , 6000 , 1000 )
57+ require .NoError (t , err )
5258 require .Equal (t , FileMD5 ("testdata/out_offset6000_limit1000.txt" ), FileMD5 ("/tmp/copy_offset6000_limit1000.txt" ))
5359}
0 commit comments