5 $Test::input_via_default
= {REDIR
=> 0, FILE
=> 0, PIPE
=> 0};
8 # test flags input expected output expected return code
10 ['1', '-d: -f1,3-', "a:b:c\n", "a:c\n", 0],
11 ['2', '-d: -f1,3-', "a:b:c\n", "a:c\n", 0],
12 ['3', '-d: -f2-', "a:b:c\n", "b:c\n", 0],
13 ['4', '-d: -f4', "a:b:c\n", "\n", 0],
14 ['5', '-d: -f4', "", "", 0],
15 ['6', '-c4', "123\n", "\n", 0],
16 ['7', '-c4', "123", "\n", 0],
17 ['8', '-c4', "123\n1", "\n\n", 0],
18 ['9', '-c4', "", "", 0],
19 ['a', '-s -d: -f3-', "a:b:c\n", "c\n", 0],
20 ['b', '-s -d: -f2,3', "a:b:c\n", "b:c\n", 0],
21 ['c', '-s -d: -f1,3', "a:b:c\n", "a:c\n", 0],
22 # Trailing colon should not be output
23 ['d', '-s -d: -f1,3', "a:b:c:\n", "a:c\n", 0],
24 ['e', '-s -d: -f3-', "a:b:c:\n", "c:\n", 0],
25 ['f', '-s -d: -f3-4', "a:b:c:\n", "c:\n", 0],
26 ['g', '-s -d: -f3,4', "a:b:c:\n", "c:\n", 0],
27 # Make sure -s suppresses non-delimited lines
28 ['h', '-s -d: -f2,3', "abc\n", "", 0],
30 ['i', '-d: -f1-3', ":::\n", "::\n", 0],
31 ['j', '-d: -f1-4', ":::\n", ":::\n", 0],
32 ['k', '-d: -f2-3', ":::\n", ":\n", 0],
33 ['l', '-d: -f2-4', ":::\n", "::\n", 0],
34 ['m', '-s -d: -f1-3', ":::\n", "::\n", 0],
35 ['n', '-s -d: -f1-4', ":::\n", ":::\n", 0],
36 ['o', '-s -d: -f2-3', ":::\n", ":\n", 0],
37 ['p', '-s -d: -f2-4', ":::\n", "::\n", 0],
38 ['q', '-s -d: -f2-4', ":::\n:\n", "::\n\n", 0],
39 ['r', '-s -d: -f2-4', ":::\n:1\n", "::\n1\n", 0],
40 ['s', '-s -d: -f1-4', ":::\n:a\n", ":::\n:a\n", 0],
41 ['t', '-s -d: -f3-', ":::\n:1\n", ":\n\n", 0],
42 # Make sure it handles empty input properly, with and without -s.
43 ['u', '-s -f3-', "", "", 0],
44 ['v', '-f3-', "", "", 0],
45 # Make sure it handles empty input properly.
46 ['w', '-b 1', "", "", 0],
47 ['x', '-s -d: -f2-4', ":\n", "\n", 0],
49 # -s may be used only with -f
50 ['y', '-s -b4', ":\n", "", 1],
51 # You must specify bytes or fields (or chars)
52 ['z', '', ":\n", "", 1],
54 ['empty-fl', '-f \'\'', ":\n", "", 1],
56 ['missing-fl', '-f', ":\n", "", 1],
58 ['empty-bl', '-b \'\'', ":\n", "", 1],
60 ['missing-bl', '-b', ":\n", "", 1],
62 # This test fails with cut from textutils-1.22.
63 ['empty-f1', '-f1', "", "", 0],
65 ['empty-f2', '-f2', "", "", 0],