Implement the rclone cat command

This commit is contained in:
Nick Craig-Wood 2016-08-18 22:43:02 +01:00
parent f22029bf3d
commit 84eb7031bb
4 changed files with 90 additions and 0 deletions

View file

@ -620,3 +620,21 @@ func TestDeduplicateRename(t *testing.T) {
}
}
}
func TestCat(t *testing.T) {
r := NewRun(t)
defer r.Finalise()
file1 := r.WriteBoth("file1", "aaa", t1)
file2 := r.WriteBoth("file2", "bbb", t2)
fstest.CheckItems(t, r.fremote, file1, file2)
var buf bytes.Buffer
err := fs.Cat(r.fremote, &buf)
require.NoError(t, err)
res := buf.String()
if res != "aaabbb" && res != "bbbaaa" {
t.Errorf("Incorrect output from Cat: %q", res)
}
}