summaryrefslogtreecommitdiff
path: root/integrationtests/dcat_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2021-11-03 09:22:49 +0200
committerPaul Buetow <paul@buetow.org>2021-11-03 09:22:49 +0200
commit426196c23fa4be59ad024f5d6891b1de047581f9 (patch)
tree9024ac46e2fcd9ad1dd6c9ba14286e1b1c514726 /integrationtests/dcat_test.go
parent69b4659b2e644506476a7285970121b3fc98c15b (diff)
Add integration test for long line splitting - Also fixed a bug regarding this along the way
Diffstat (limited to 'integrationtests/dcat_test.go')
-rw-r--r--integrationtests/dcat_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/integrationtests/dcat_test.go b/integrationtests/dcat_test.go
index bef5db2..d07279a 100644
--- a/integrationtests/dcat_test.go
+++ b/integrationtests/dcat_test.go
@@ -68,6 +68,33 @@ func TestDCat2(t *testing.T) {
os.Remove(outFile)
}
+func TestDCat3(t *testing.T) {
+ if !config.Env("DTAIL_INTEGRATION_TEST_RUN_MODE") {
+ return
+ }
+ inFile := "dcat3.txt"
+ expectedFile := "dcat3.txt.expected"
+ outFile := "dcat3.out"
+
+ args := []string{"--plain", "--logLevel", "error", "--cfg", "none", inFile}
+
+ // Split up long lines to smaller ones.
+ os.Setenv("DTAIL_MAX_LINE_LENGTH", "1000")
+
+ _, err := runCommand(context.TODO(), t, outFile, "../dcat", args...)
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+ if err := compareFilesContents(t, outFile, expectedFile); err != nil {
+ t.Error(err)
+ return
+ }
+
+ os.Remove(outFile)
+}
+
func TestDCatColors(t *testing.T) {
if !config.Env("DTAIL_INTEGRATION_TEST_RUN_MODE") {
return