diff options
| author | Paul Buetow <paul@buetow.org> | 2021-10-13 09:00:03 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-10-13 09:00:03 +0300 |
| commit | 7b873100d94ddc3c698a620cb83b61dcb2074303 (patch) | |
| tree | 7ecbbce3c7d7c52671b8cb26eb15260b529e9236 /integrationtests/dcat_test.go | |
| parent | a6098084f7150df34edecf1519386bd28a527361 (diff) | |
add another dcat integration test - catting 100 files at once
Diffstat (limited to 'integrationtests/dcat_test.go')
| -rw-r--r-- | integrationtests/dcat_test.go | 30 |
1 files changed, 28 insertions, 2 deletions
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) +} |
