t: different input options besides parameters
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 30 Nov 2022 14:07:21 +0000 (15:07 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 4 Dec 2022 22:52:20 +0000 (23:52 +0100)
t/regress.t
t/t1704-input_separator.out [new file with mode: 0644]
t/t1705-input_twice.out [new file with mode: 0644]
t/t1707-stdin.out [new file with mode: 0644]
t/t1708-empty_stdin.out [new file with mode: 0644]

index c9107486b6fd710461bd851d3522c0e2fc0e310f..a10827b1eac937a35dc1ef02d1d10aab1938e93a 100755 (executable)
@@ -43,7 +43,7 @@ for my $candidate (@params) {
        my $shell = $script;
        if ($script =~ /\|/) {
                # explicit shell wrapper to capture all warnings
-               $script =~ s/'/'\\''/g;
+               $shell =~ s/'/'\\''/g;
                $shell = "sh -c '$shell'";
        }
        $shell .= ' 2>' . ($wantwarn ? '&1' : '/dev/null');
diff --git a/t/t1704-input_separator.out b/t/t1704-input_separator.out
new file mode 100644 (file)
index 0000000..6236534
--- /dev/null
@@ -0,0 +1,4 @@
+barcat -- input/seq3.txt
+1 -------------
+2 ------------------------+
+3 ------------------------+----->-------
diff --git a/t/t1705-input_twice.out b/t/t1705-input_twice.out
new file mode 100644 (file)
index 0000000..53c9f03
--- /dev/null
@@ -0,0 +1,7 @@
+barcat input/seq3.txt input/seq3.txt
+1 -------------
+2 ------------------------+
+3 ------------------------+----->-------
+1 -------------
+2 ------------------------+
+3 ------------------------+----->-------
diff --git a/t/t1707-stdin.out b/t/t1707-stdin.out
new file mode 100644 (file)
index 0000000..a754b89
--- /dev/null
@@ -0,0 +1,4 @@
+cat input/seq3.txt | barcat
+1 -------------
+2 ------------------------+
+3 ------------------------+----->-------
diff --git a/t/t1708-empty_stdin.out b/t/t1708-empty_stdin.out
new file mode 100644 (file)
index 0000000..2256b6b
--- /dev/null
@@ -0,0 +1 @@
+printf '' | barcat