diff --git a/test/001_trivial.txt b/test/001_trivial.txt index 8bd5b39..10f8745 100644 --- a/test/001_trivial.txt +++ b/test/001_trivial.txt @@ -1,6 +1,7 @@ :ARGS :INPUT foo +:OUTPUT-FILTER :EXPECTED /*******/ /* foo */ diff --git a/test/002_trivial_10x5.txt b/test/002_trivial_10x5.txt index 0365c75..0d98f49 100644 --- a/test/002_trivial_10x5.txt +++ b/test/002_trivial_10x5.txt @@ -2,6 +2,7 @@ -s 10x5 :INPUT foo +:OUTPUT-FILTER :EXPECTED /********/ /* foo */ diff --git a/test/003_no_config_file.txt b/test/003_no_config_file.txt index 8f44094..1efa00d 100644 --- a/test/003_no_config_file.txt +++ b/test/003_no_config_file.txt @@ -1,6 +1,7 @@ :ARGS -f nonexistent :INPUT +:OUTPUT-FILTER :EXPECTED-ERROR 1 boxes: Couldn't open config file 'nonexistent' for input. :EOF diff --git a/test/004_missing_option_argument.txt b/test/004_missing_option_argument.txt index c168703..fc34c96 100644 --- a/test/004_missing_option_argument.txt +++ b/test/004_missing_option_argument.txt @@ -1,8 +1,10 @@ :ARGS -s :INPUT +:OUTPUT-FILTER +1s/^.\+: /boxes: / :EXPECTED-ERROR 1 -../src/boxes: option requires an argument -- 's' +boxes: option requires an argument -- 's' Usage: boxes [options] [infile [outfile]] Try `boxes -h' for more information. :EOF diff --git a/test/005_alignment_single_line_hlvt.txt b/test/005_alignment_single_line_hlvt.txt index 71f8aad..d394bda 100644 --- a/test/005_alignment_single_line_hlvt.txt +++ b/test/005_alignment_single_line_hlvt.txt @@ -2,6 +2,7 @@ -s 15x5 -a hlvt :INPUT foo +:OUTPUT-FILTER :EXPECTED /*************/ /* foo */ diff --git a/test/006_alignment_single_line_hlvc.txt b/test/006_alignment_single_line_hlvc.txt index 266ae4d..2460d3a 100644 --- a/test/006_alignment_single_line_hlvc.txt +++ b/test/006_alignment_single_line_hlvc.txt @@ -2,6 +2,7 @@ -s 15x5 -a hlvc :INPUT foo +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/007_alignment_single_line_hlvb.txt b/test/007_alignment_single_line_hlvb.txt index bc2d6ab..4e0478e 100644 --- a/test/007_alignment_single_line_hlvb.txt +++ b/test/007_alignment_single_line_hlvb.txt @@ -2,6 +2,7 @@ -s 15x5 -a hlvb :INPUT foo +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/008_alignment_single_line_hcvt.txt b/test/008_alignment_single_line_hcvt.txt index 3781146..b1b5709 100644 --- a/test/008_alignment_single_line_hcvt.txt +++ b/test/008_alignment_single_line_hcvt.txt @@ -2,6 +2,7 @@ -s 15x5 -a hcvt :INPUT foo +:OUTPUT-FILTER :EXPECTED /*************/ /* foo */ diff --git a/test/009_alignment_single_line_hcvc.txt b/test/009_alignment_single_line_hcvc.txt index 9da835d..f45edb3 100644 --- a/test/009_alignment_single_line_hcvc.txt +++ b/test/009_alignment_single_line_hcvc.txt @@ -2,6 +2,7 @@ -s 15x5 -a hcvc :INPUT foo +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/010_alignment_single_line_hcvb.txt b/test/010_alignment_single_line_hcvb.txt index 2474f3d..646c15c 100644 --- a/test/010_alignment_single_line_hcvb.txt +++ b/test/010_alignment_single_line_hcvb.txt @@ -2,6 +2,7 @@ -s 15x5 -a hcvb :INPUT foo +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/011_alignment_single_line_hrvt.txt b/test/011_alignment_single_line_hrvt.txt index 47866ca..2542ddd 100644 --- a/test/011_alignment_single_line_hrvt.txt +++ b/test/011_alignment_single_line_hrvt.txt @@ -2,6 +2,7 @@ -s 15x5 -a hrvt :INPUT foo +:OUTPUT-FILTER :EXPECTED /*************/ /* foo */ diff --git a/test/012_alignment_single_line_hrvc.txt b/test/012_alignment_single_line_hrvc.txt index 65c6b44..fdc6b5c 100644 --- a/test/012_alignment_single_line_hrvc.txt +++ b/test/012_alignment_single_line_hrvc.txt @@ -2,6 +2,7 @@ -s 15x5 -a hrvc :INPUT foo +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/013_alignment_single_line_hrvb.txt b/test/013_alignment_single_line_hrvb.txt index a295f1a..ae142ad 100644 --- a/test/013_alignment_single_line_hrvb.txt +++ b/test/013_alignment_single_line_hrvb.txt @@ -2,6 +2,7 @@ -s 15x5 -a hrvb :INPUT foo +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/014_alignment_single_line_l.txt b/test/014_alignment_single_line_l.txt index 47ade1c..cba0ece 100644 --- a/test/014_alignment_single_line_l.txt +++ b/test/014_alignment_single_line_l.txt @@ -2,6 +2,7 @@ -s 15x5 -a l :INPUT foo +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/015_alignment_single_line_c.txt b/test/015_alignment_single_line_c.txt index 55f1253..2d4f253 100644 --- a/test/015_alignment_single_line_c.txt +++ b/test/015_alignment_single_line_c.txt @@ -2,6 +2,7 @@ -s 15x5 -a c :INPUT foo +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/016_alignment_single_line_r.txt b/test/016_alignment_single_line_r.txt index 1a7f543..cb5e155 100644 --- a/test/016_alignment_single_line_r.txt +++ b/test/016_alignment_single_line_r.txt @@ -2,6 +2,7 @@ -s 15x5 -a r :INPUT foo +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/017_alignment_multiline_hlvtjl.txt b/test/017_alignment_multiline_hlvtjl.txt index eb65750..3b46e9c 100644 --- a/test/017_alignment_multiline_hlvtjl.txt +++ b/test/017_alignment_multiline_hlvtjl.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/018_alignment_multiline_hlvtjc.txt b/test/018_alignment_multiline_hlvtjc.txt index 3ca94b2..777557c 100644 --- a/test/018_alignment_multiline_hlvtjc.txt +++ b/test/018_alignment_multiline_hlvtjc.txt @@ -5,6 +5,7 @@ The row of 'b's shows how position is rounded down if necessary. aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/019_alignment_multiline_hlvtjr.txt b/test/019_alignment_multiline_hlvtjr.txt index e7fbc8d..f7dcfdf 100644 --- a/test/019_alignment_multiline_hlvtjr.txt +++ b/test/019_alignment_multiline_hlvtjr.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/020_alignment_multiline_hlvcjl.txt b/test/020_alignment_multiline_hlvcjl.txt index 527edbe..930085f 100644 --- a/test/020_alignment_multiline_hlvcjl.txt +++ b/test/020_alignment_multiline_hlvcjl.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/021_alignment_multiline_hlvcjc.txt b/test/021_alignment_multiline_hlvcjc.txt index c7c7928..30c3b21 100644 --- a/test/021_alignment_multiline_hlvcjc.txt +++ b/test/021_alignment_multiline_hlvcjc.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/022_alignment_multiline_hlvcjr.txt b/test/022_alignment_multiline_hlvcjr.txt index 3d86018..6f0fb33 100644 --- a/test/022_alignment_multiline_hlvcjr.txt +++ b/test/022_alignment_multiline_hlvcjr.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/023_alignment_multiline_hlvbjl.txt b/test/023_alignment_multiline_hlvbjl.txt index 045216d..7df9836 100644 --- a/test/023_alignment_multiline_hlvbjl.txt +++ b/test/023_alignment_multiline_hlvbjl.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/024_alignment_multiline_hlvbjc.txt b/test/024_alignment_multiline_hlvbjc.txt index ab0dc99..1fade0e 100644 --- a/test/024_alignment_multiline_hlvbjc.txt +++ b/test/024_alignment_multiline_hlvbjc.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/025_alignment_multiline_hlvbjr.txt b/test/025_alignment_multiline_hlvbjr.txt index b1e73d3..ea1ac92 100644 --- a/test/025_alignment_multiline_hlvbjr.txt +++ b/test/025_alignment_multiline_hlvbjr.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/026_alignment_multiline_hcvtjl.txt b/test/026_alignment_multiline_hcvtjl.txt index 278ebd7..f74b298 100644 --- a/test/026_alignment_multiline_hcvtjl.txt +++ b/test/026_alignment_multiline_hcvtjl.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/027_alignment_multiline_hcvtjc.txt b/test/027_alignment_multiline_hcvtjc.txt index af51645..a12d967 100644 --- a/test/027_alignment_multiline_hcvtjc.txt +++ b/test/027_alignment_multiline_hcvtjc.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/028_alignment_multiline_hcvtjr.txt b/test/028_alignment_multiline_hcvtjr.txt index b1def7d..f589b9b 100644 --- a/test/028_alignment_multiline_hcvtjr.txt +++ b/test/028_alignment_multiline_hcvtjr.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/029_alignment_multiline_hcvcjl.txt b/test/029_alignment_multiline_hcvcjl.txt index c45dd91..d7189e7 100644 --- a/test/029_alignment_multiline_hcvcjl.txt +++ b/test/029_alignment_multiline_hcvcjl.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/030_alignment_multiline_hcvcjc.txt b/test/030_alignment_multiline_hcvcjc.txt index ae1d218..826ed12 100644 --- a/test/030_alignment_multiline_hcvcjc.txt +++ b/test/030_alignment_multiline_hcvcjc.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/031_alignment_multiline_hcvcjr.txt b/test/031_alignment_multiline_hcvcjr.txt index e1ff00d..c673bbe 100644 --- a/test/031_alignment_multiline_hcvcjr.txt +++ b/test/031_alignment_multiline_hcvcjr.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/032_alignment_multiline_hcvbjl.txt b/test/032_alignment_multiline_hcvbjl.txt index 030a022..d732c60 100644 --- a/test/032_alignment_multiline_hcvbjl.txt +++ b/test/032_alignment_multiline_hcvbjl.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/033_alignment_multiline_hcvbjc.txt b/test/033_alignment_multiline_hcvbjc.txt index efd378b..4354cf7 100644 --- a/test/033_alignment_multiline_hcvbjc.txt +++ b/test/033_alignment_multiline_hcvbjc.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/034_alignment_multiline_hcvbjr.txt b/test/034_alignment_multiline_hcvbjr.txt index bd3ab1b..a873323 100644 --- a/test/034_alignment_multiline_hcvbjr.txt +++ b/test/034_alignment_multiline_hcvbjr.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/035_alignment_multiline_hrvtjl.txt b/test/035_alignment_multiline_hrvtjl.txt index 4cac1cd..9ee0631 100644 --- a/test/035_alignment_multiline_hrvtjl.txt +++ b/test/035_alignment_multiline_hrvtjl.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/036_alignment_multiline_hrvtjc.txt b/test/036_alignment_multiline_hrvtjc.txt index 2a7deee..81b2f0a 100644 --- a/test/036_alignment_multiline_hrvtjc.txt +++ b/test/036_alignment_multiline_hrvtjc.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/037_alignment_multiline_hrvtjr.txt b/test/037_alignment_multiline_hrvtjr.txt index 4c5a33c..a7d343f 100644 --- a/test/037_alignment_multiline_hrvtjr.txt +++ b/test/037_alignment_multiline_hrvtjr.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/038_alignment_multiline_hrvcjl.txt b/test/038_alignment_multiline_hrvcjl.txt index 87428dc..01e0e42 100644 --- a/test/038_alignment_multiline_hrvcjl.txt +++ b/test/038_alignment_multiline_hrvcjl.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/039_alignment_multiline_hrvcjc.txt b/test/039_alignment_multiline_hrvcjc.txt index 917fc8a..56d2f7c 100644 --- a/test/039_alignment_multiline_hrvcjc.txt +++ b/test/039_alignment_multiline_hrvcjc.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/040_alignment_multiline_hrvcjr.txt b/test/040_alignment_multiline_hrvcjr.txt index 39aae9d..45a3fbc 100644 --- a/test/040_alignment_multiline_hrvcjr.txt +++ b/test/040_alignment_multiline_hrvcjr.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/041_alignment_multiline_hrvbjl.txt b/test/041_alignment_multiline_hrvbjl.txt index d9bd217..93e37d7 100644 --- a/test/041_alignment_multiline_hrvbjl.txt +++ b/test/041_alignment_multiline_hrvbjl.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/042_alignment_multiline_hrvbjc.txt b/test/042_alignment_multiline_hrvbjc.txt index 54b6b12..2802e84 100644 --- a/test/042_alignment_multiline_hrvbjc.txt +++ b/test/042_alignment_multiline_hrvbjc.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/043_alignment_multiline_hrvbjr.txt b/test/043_alignment_multiline_hrvbjr.txt index d1b526a..d43247e 100644 --- a/test/043_alignment_multiline_hrvbjr.txt +++ b/test/043_alignment_multiline_hrvbjr.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/044_alignment_multiline_l.txt b/test/044_alignment_multiline_l.txt index 659f7d5..47626f1 100644 --- a/test/044_alignment_multiline_l.txt +++ b/test/044_alignment_multiline_l.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/045_alignment_multiline_c.txt b/test/045_alignment_multiline_c.txt index 3dba16f..1ade968 100644 --- a/test/045_alignment_multiline_c.txt +++ b/test/045_alignment_multiline_c.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/046_alignment_multiline_r.txt b/test/046_alignment_multiline_r.txt index 26cec05..1f0013c 100644 --- a/test/046_alignment_multiline_r.txt +++ b/test/046_alignment_multiline_r.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/047_alignment_multiline_none.txt b/test/047_alignment_multiline_none.txt index 47d8b89..ee2a4a4 100644 --- a/test/047_alignment_multiline_none.txt +++ b/test/047_alignment_multiline_none.txt @@ -5,6 +5,7 @@ If no alignment option is given, text is aligned left and put in the top left co aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/048_alignment_multiline_vertical_round_down.txt b/test/048_alignment_multiline_vertical_round_down.txt index 88c18fd..f4db3b4 100644 --- a/test/048_alignment_multiline_vertical_round_down.txt +++ b/test/048_alignment_multiline_vertical_round_down.txt @@ -3,6 +3,7 @@ :INPUT aaa bbbb +:OUTPUT-FILTER :EXPECTED /*************/ /* */ diff --git a/test/049_alignment_illegal_format.txt b/test/049_alignment_illegal_format.txt index 7edbb46..1e1481b 100644 --- a/test/049_alignment_illegal_format.txt +++ b/test/049_alignment_illegal_format.txt @@ -2,6 +2,7 @@ -a mistake :INPUT foo +:OUTPUT-FILTER :EXPECTED-ERROR 1 boxes: Illegal text format -- mistake :EOF \ No newline at end of file diff --git a/test/050_alignment_multiline_nop1.txt b/test/050_alignment_multiline_nop1.txt index 5fcf3a5..729bf76 100644 --- a/test/050_alignment_multiline_nop1.txt +++ b/test/050_alignment_multiline_nop1.txt @@ -4,6 +4,7 @@ XXXXX XXXXX XXXXX +:OUTPUT-FILTER :EXPECTED /*********/ /* XXXXX */ diff --git a/test/051_alignment_multiline_nop2.txt b/test/051_alignment_multiline_nop2.txt index 0d1a722..ea80064 100644 --- a/test/051_alignment_multiline_nop2.txt +++ b/test/051_alignment_multiline_nop2.txt @@ -4,6 +4,7 @@ XXXXX XXXXX XXXXX +:OUTPUT-FILTER :EXPECTED /*********/ /* XXXXX */ diff --git a/test/052_simple_line_comment.txt b/test/052_simple_line_comment.txt index 8ec0682..270ac0b 100644 --- a/test/052_simple_line_comment.txt +++ b/test/052_simple_line_comment.txt @@ -6,6 +6,7 @@ a bbb +:OUTPUT-FILTER :EXPECTED # a # diff --git a/test/053_size_25x10.txt b/test/053_size_25x10.txt index e23d3ba..bd93fe9 100644 --- a/test/053_size_25x10.txt +++ b/test/053_size_25x10.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /***********************/ /* aaa */ diff --git a/test/054_size_vs_padding_1.txt b/test/054_size_vs_padding_1.txt index 1ca9cb6..3742a38 100644 --- a/test/054_size_vs_padding_1.txt +++ b/test/054_size_vs_padding_1.txt @@ -5,6 +5,7 @@ Size takes precedence over padding, left padding is killed first aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /********/ /*aaa */ diff --git a/test/055_size_vs_padding_2.txt b/test/055_size_vs_padding_2.txt index cc83e69..4d3b0a7 100644 --- a/test/055_size_vs_padding_2.txt +++ b/test/055_size_vs_padding_2.txt @@ -5,6 +5,7 @@ Size takes precedence over padding aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*******/ /*aaa */ diff --git a/test/056_input_vs_size.txt b/test/056_input_vs_size.txt index c1df554..94e1fd3 100644 --- a/test/056_input_vs_size.txt +++ b/test/056_input_vs_size.txt @@ -5,6 +5,7 @@ Input length takes precedence over size option aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*******/ /*aaa */ diff --git a/test/057_size_vs_padding_2.txt b/test/057_size_vs_padding_2.txt index ef0dffe..2352eac 100644 --- a/test/057_size_vs_padding_2.txt +++ b/test/057_size_vs_padding_2.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /****************************/ /* aaa */ diff --git a/test/058_size_minimum_by_design.txt b/test/058_size_minimum_by_design.txt index b820266..5863269 100644 --- a/test/058_size_minimum_by_design.txt +++ b/test/058_size_minimum_by_design.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /\ /\ /\ /\//\\/\ /\//\\/\ /\//\\/\ diff --git a/test/059_size_same_as_design.txt b/test/059_size_same_as_design.txt index 8a96cac..1a69a18 100644 --- a/test/059_size_same_as_design.txt +++ b/test/059_size_same_as_design.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /\ /\ /\ /\//\\/\ /\//\\/\ /\//\\/\ diff --git a/test/060_size_1_extra_line.txt b/test/060_size_1_extra_line.txt index d56ea67..fccd02e 100644 --- a/test/060_size_1_extra_line.txt +++ b/test/060_size_1_extra_line.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /\ /\ /\ /\//\\/\ /\//\\/\ /\//\\/\ diff --git a/test/061_size_1_extra_line_and_1_extra_column.txt b/test/061_size_1_extra_line_and_1_extra_column.txt index e82721d..23abcc0 100644 --- a/test/061_size_1_extra_line_and_1_extra_column.txt +++ b/test/061_size_1_extra_line_and_1_extra_column.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /\ /\ /\ /\ /\//\\/\ /\//\\/\ /\//\\/\ /\//\\/\ diff --git a/test/062_size_with_indent.txt b/test/062_size_with_indent.txt index 62203b9..6b301f6 100644 --- a/test/062_size_with_indent.txt +++ b/test/062_size_with_indent.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/063_size_with_indent_and_padding.txt b/test/063_size_with_indent_and_padding.txt index fb69d26..0f4e790 100644 --- a/test/063_size_with_indent_and_padding.txt +++ b/test/063_size_with_indent_and_padding.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/064_size_with_indent_and_too_much_padding.txt b/test/064_size_with_indent_and_too_much_padding.txt index 4f5ebe3..a0e68ab 100644 --- a/test/064_size_with_indent_and_too_much_padding.txt +++ b/test/064_size_with_indent_and_too_much_padding.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/065_size_missing_argument.txt b/test/065_size_missing_argument.txt index 7ee98e5..cb77672 100644 --- a/test/065_size_missing_argument.txt +++ b/test/065_size_missing_argument.txt @@ -2,8 +2,10 @@ -s :INPUT foo +:OUTPUT-FILTER +1s/^.\+: /boxes: / :EXPECTED-ERROR 1 -../src/boxes: option requires an argument -- 's' +boxes: option requires an argument -- 's' Usage: boxes [options] [infile [outfile]] Try `boxes -h' for more information. :EOF \ No newline at end of file diff --git a/test/066_size_invalid_spec.txt b/test/066_size_invalid_spec.txt index e43412d..6f12787 100644 --- a/test/066_size_invalid_spec.txt +++ b/test/066_size_invalid_spec.txt @@ -2,6 +2,7 @@ -s -2x3 :INPUT foo +:OUTPUT-FILTER :EXPECTED-ERROR 1 boxes: invalid box size specification -- -2x3 :EOF \ No newline at end of file diff --git a/test/067_size_as_small_as_possible_vertical.txt b/test/067_size_as_small_as_possible_vertical.txt index e1fd8aa..81b263b 100644 --- a/test/067_size_as_small_as_possible_vertical.txt +++ b/test/067_size_as_small_as_possible_vertical.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*********/ /* aaa */ diff --git a/test/068_size_single_argument.txt b/test/068_size_single_argument.txt index f85d3af..f07e040 100644 --- a/test/068_size_single_argument.txt +++ b/test/068_size_single_argument.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*************/ /* aaa */ diff --git a/test/069_size_single_argument_x.txt b/test/069_size_single_argument_x.txt index 437e7a3..9c111c7 100644 --- a/test/069_size_single_argument_x.txt +++ b/test/069_size_single_argument_x.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*********/ /* aaa */ diff --git a/test/070_size_as_small_as_possible_horiz.txt b/test/070_size_as_small_as_possible_horiz.txt index 9cad9d7..d53c1b2 100644 --- a/test/070_size_as_small_as_possible_horiz.txt +++ b/test/070_size_as_small_as_possible_horiz.txt @@ -4,6 +4,7 @@ aaa bbbb ccccc +:OUTPUT-FILTER :EXPECTED /*******/ /*aaa */ diff --git a/test/071_size_invalid_spec_0x0.txt b/test/071_size_invalid_spec_0x0.txt index 46dab0b..d6928de 100644 --- a/test/071_size_invalid_spec_0x0.txt +++ b/test/071_size_invalid_spec_0x0.txt @@ -2,6 +2,7 @@ -s 0x0 :INPUT foo +:OUTPUT-FILTER :EXPECTED-ERROR 1 boxes: invalid box size specification -- 0x0 :EOF \ No newline at end of file diff --git a/test/072_tab_expanded_split.txt b/test/072_tab_expanded_split.txt index 10458bb..02803ec 100644 --- a/test/072_tab_expanded_split.txt +++ b/test/072_tab_expanded_split.txt @@ -3,6 +3,7 @@ XXXXXX XXXXXX XXXXXX +:OUTPUT-FILTER :EXPECTED /**************/ /* XXXXXX */ diff --git a/test/073_tab_expanded_size4.txt b/test/073_tab_expanded_size4.txt index 0ec7af5..a1b8108 100644 --- a/test/073_tab_expanded_size4.txt +++ b/test/073_tab_expanded_size4.txt @@ -4,6 +4,7 @@ XXXXXX XXXXXX XXXXXX +:OUTPUT-FILTER :EXPECTED /**********/ /* XXXXXX */ diff --git a/test/074_tab_keep_size4.txt b/test/074_tab_keep_size4.txt index 48db463..fe242aa 100644 --- a/test/074_tab_keep_size4.txt +++ b/test/074_tab_keep_size4.txt @@ -4,6 +4,7 @@ XXXXXX XXXXXX XXXXXX +:OUTPUT-FILTER :EXPECTED /**********/ /* XXXXXX */ diff --git a/test/075_tab_unexpand.txt b/test/075_tab_unexpand.txt index de0d1ed..3449023 100644 --- a/test/075_tab_unexpand.txt +++ b/test/075_tab_unexpand.txt @@ -4,6 +4,7 @@ XXXXXX XXXXXX XXXXXX +:OUTPUT-FILTER :EXPECTED /**********/ /* XXXXXX */ diff --git a/test/076_tab_keep_size4_withContent.txt b/test/076_tab_keep_size4_withContent.txt index 03a23fc..4139f2a 100644 --- a/test/076_tab_keep_size4_withContent.txt +++ b/test/076_tab_keep_size4_withContent.txt @@ -4,6 +4,7 @@ XXXXXX XXX XXX XXXXXX +:OUTPUT-FILTER :EXPECTED /***********/ /* XXXXXX */ diff --git a/test/077_tab_unexpand_size8_withContent.txt b/test/077_tab_unexpand_size8_withContent.txt index 193ba59..44f609b 100644 --- a/test/077_tab_unexpand_size8_withContent.txt +++ b/test/077_tab_unexpand_size8_withContent.txt @@ -5,6 +5,7 @@ Because input lines 1 and 3 are only 4 spaces, no tabs can be unexpanded! XXXXXX XXX XXX XXXXXX +:OUTPUT-FILTER :EXPECTED /*******************/ /* XXXXXX */ diff --git a/test/078_tab_unexpand_size8_withContent2.txt b/test/078_tab_unexpand_size8_withContent2.txt index c383de2..7606644 100644 --- a/test/078_tab_unexpand_size8_withContent2.txt +++ b/test/078_tab_unexpand_size8_withContent2.txt @@ -4,6 +4,7 @@ XXXXXX XXX XXX XXXXXX +:OUTPUT-FILTER :EXPECTED /***************/ /* XXXXXX */ diff --git a/test/079_tab_keep_size8.txt b/test/079_tab_keep_size8.txt index ef61b3c..07ba3a9 100644 --- a/test/079_tab_keep_size8.txt +++ b/test/079_tab_keep_size8.txt @@ -4,6 +4,7 @@ XXXXXX XXX XXX XXXXXX +:OUTPUT-FILTER :EXPECTED /***************/ /* XXXXXX */ diff --git a/test/080_tab_expand_size4.txt b/test/080_tab_expand_size4.txt index 3f4b287..ffdeb43 100644 --- a/test/080_tab_expand_size4.txt +++ b/test/080_tab_expand_size4.txt @@ -4,6 +4,7 @@ XXXXXX XXXXXX XXXXXX +:OUTPUT-FILTER :EXPECTED /**********/ /* XXXXXX */ diff --git a/test/081_tab_unexpand_size4_fromNone.txt b/test/081_tab_unexpand_size4_fromNone.txt index 6fe9baa..8314f9f 100644 --- a/test/081_tab_unexpand_size4_fromNone.txt +++ b/test/081_tab_unexpand_size4_fromNone.txt @@ -4,6 +4,7 @@ XXXXXX XXXXXX XXXXXX +:OUTPUT-FILTER :EXPECTED /**********/ /* XXXXXX */ diff --git a/test/082_tab_unexpand_size4_split.txt b/test/082_tab_unexpand_size4_split.txt index 1c9e925..8d31033 100644 --- a/test/082_tab_unexpand_size4_split.txt +++ b/test/082_tab_unexpand_size4_split.txt @@ -4,6 +4,7 @@ XXXXXX XXXXXX XXXXXX +:OUTPUT-FILTER :EXPECTED /**********/ /* XXXXXX */ diff --git a/test/testrunner.sh b/test/testrunner.sh index 6bc0a37..0ef025d 100755 --- a/test/testrunner.sh +++ b/test/testrunner.sh @@ -45,7 +45,7 @@ fi echo "Running test case: $testCaseFile" declare sectionName -for sectionName in :ARGS :INPUT :EXPECTED :EOF; do +for sectionName in :ARGS :INPUT :OUTPUT-FILTER :EXPECTED :EOF; do if [ $(grep -c ^$sectionName $testCaseFile) -ne 1 ]; then >&2 echo "Missing section $sectionName in test case '$testCaseFile'." exit 4 @@ -59,11 +59,13 @@ fi declare -r testInputFile=${testCaseFile/%.txt/.input.tmp} declare -r testExpectationFile=${testCaseFile/%.txt/.expected.tmp} +declare -r testFilterFile=${testCaseFile/%.txt/.sed.tmp} declare -r testOutputFile=${testCaseFile/%.txt/.out.tmp} declare -r boxesArgs=$(cat $testCaseFile | sed -n '/^:ARGS/,+1p' | grep -v ^:INPUT | sed '1d') -cat $testCaseFile | sed -n '/^:INPUT/,/^:EXPECTED\b.*$/p;' | sed '1d;$d' | tr -d '\r' > $testInputFile -cat $testCaseFile | sed -n '/^:EXPECTED/,/^:EOF\b.*$/p;' | sed '1d;$d' | tr -d '\r' > $testExpectationFile +cat $testCaseFile | sed -n '/^:INPUT/,/^:OUTPUT-FILTER/p;' | sed '1d;$d' | tr -d '\r' > $testInputFile +cat $testCaseFile | sed -n '/^:OUTPUT-FILTER/,/^:EXPECTED\b.*$/p;' | sed '1d;$d' | tr -d '\r' > $testFilterFile +cat $testCaseFile | sed -n '/^:EXPECTED/,/^:EOF/p;' | sed '1d;$d' | tr -d '\r' > $testExpectationFile declare boxesBinary=../src/boxes.exe if [ ! -x $boxesBinary ]; then @@ -75,7 +77,7 @@ export BOXES=../boxes-config cat $testInputFile | $boxesBinary $boxesArgs >$testOutputFile 2>&1 declare -ir actualReturnCode=$? -cat $testOutputFile | tr -d '\r' | diff - $testExpectationFile +cat $testOutputFile | tr -d '\r' | sed -f $testFilterFile | diff - $testExpectationFile if [ $? -ne 0 ]; then >&2 echo "Error in test case: $testCaseFile (top: actual; bottom: expected)" exit 5 @@ -86,6 +88,7 @@ if [ $actualReturnCode -ne $expectedReturnCode ]; then fi rm $testInputFile +rm $testFilterFile rm $testExpectationFile rm $testOutputFile