From 7b873100d94ddc3c698a620cb83b61dcb2074303 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 13 Oct 2021 09:00:03 +0300 Subject: add another dcat integration test - catting 100 files at once --- integrationtests/dcat_test.go | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'integrationtests/dcat_test.go') diff --git a/integrationtests/dcat_test.go b/integrationtests/dcat_test.go index e172bfa..5dfd08e 100644 --- a/integrationtests/dcat_test.go +++ b/integrationtests/dcat_test.go @@ -7,10 +7,10 @@ import ( ) func TestDCat(t *testing.T) { - testdataFile := "dcat.txt.expected" + testdataFile := "dcat.txt" stdoutFile := "dcat.out" - _, err := runCommand(context.TODO(), stdoutFile, + _, err := runCommand(context.TODO(), t, stdoutFile, "../dcat", "--spartan", testdataFile) if err != nil { @@ -25,3 +25,29 @@ func TestDCat(t *testing.T) { os.Remove(stdoutFile) } + +func TestDCat2(t *testing.T) { + testdataFile := "dcat2.txt" + expectedFile := "dcat2.txt.expected" + stdoutFile := "dcat2.out" + + args := []string{"--spartan", "--logLevel", "error"} + + // Cat file 100 times in one session. + for i := 0; i < 100; i++ { + args = append(args, testdataFile) + } + + if _, err := runCommand(context.TODO(), t, stdoutFile, "../dcat", args...); err != nil { + t.Error(err) + return + } + + if err := compareFilesContents(t, stdoutFile, expectedFile); err != nil { + t.Error(err) + return + } + + os.Remove(stdoutFile) + os.Remove(expectedFile) +} -- cgit v1.2.3