mirror of
https://github.com/ascii-boxes/boxes.git
synced 2024-12-12 09:51:10 +01:00
Test cases for eol control option #60
This also adds the ability to testrunner.sh to pipe the output through xxd for binary comparisons.
This commit is contained in:
parent
139994f97f
commit
6427d1efde
16
test/152_eol_control_crlf.txt
Normal file
16
test/152_eol_control_crlf.txt
Normal file
@ -0,0 +1,16 @@
|
||||
:DESC
|
||||
Test that the line terminator can be forced to CRLF.
|
||||
|
||||
:ENV
|
||||
export BOXES_TEST_XXD=1
|
||||
:ARGS
|
||||
-f ../boxes-config -d c -e crlf
|
||||
:INPUT
|
||||
foo
|
||||
:OUTPUT-FILTER
|
||||
s/^.*([0-9a-fA-F]{4}):/0000\1:/
|
||||
:EXPECTED
|
||||
00000000: 2f2a 2a2a 2a2a 2a2a 2f0d 0a2f 2a20 666f /*******/../* fo
|
||||
00000010: 6f20 2a2f 0d0a 2f2a 2a2a 2a2a 2a2a 2f0d o */../*******/.
|
||||
00000020: 0a .
|
||||
:EOF
|
15
test/153_eol_control_lf.txt
Normal file
15
test/153_eol_control_lf.txt
Normal file
@ -0,0 +1,15 @@
|
||||
:DESC
|
||||
Test that the line terminator can be forced to LF.
|
||||
|
||||
:ENV
|
||||
export BOXES_TEST_XXD=1
|
||||
:ARGS
|
||||
-f ../boxes-config -d c -e lf
|
||||
:INPUT
|
||||
foo
|
||||
:OUTPUT-FILTER
|
||||
s/^.*([0-9a-fA-F]{4}):/0000\1:/
|
||||
:EXPECTED
|
||||
00000000: 2f2a 2a2a 2a2a 2a2a 2f0a 2f2a 2066 6f6f /*******/./* foo
|
||||
00000010: 202a 2f0a 2f2a 2a2a 2a2a 2a2a 2f0a */./*******/.
|
||||
:EOF
|
15
test/154_eol_control_cr.txt
Normal file
15
test/154_eol_control_cr.txt
Normal file
@ -0,0 +1,15 @@
|
||||
:DESC
|
||||
Test that the line terminator can be forced to CR.
|
||||
|
||||
:ENV
|
||||
export BOXES_TEST_XXD=1
|
||||
:ARGS
|
||||
-f ../boxes-config -d c -e Cr
|
||||
:INPUT
|
||||
foo
|
||||
:OUTPUT-FILTER
|
||||
s/^.*([0-9a-fA-F]{4}):/0000\1:/
|
||||
:EXPECTED
|
||||
00000000: 2f2a 2a2a 2a2a 2a2a 2f0d 2f2a 2066 6f6f /*******/./* foo
|
||||
00000010: 202a 2f0d 2f2a 2a2a 2a2a 2a2a 2f0d */./*******/.
|
||||
:EOF
|
11
test/155_eol_control_invalid.txt
Normal file
11
test/155_eol_control_invalid.txt
Normal file
@ -0,0 +1,11 @@
|
||||
:DESC
|
||||
Test that invalid line terminator specs are properly reported.
|
||||
|
||||
:ARGS
|
||||
-e INVALID
|
||||
:INPUT
|
||||
foo
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED-ERROR 1
|
||||
boxes: invalid eol spec -- INVALID
|
||||
:EOF
|
74
test/156_eol_control_crlf_design_info.txt
Normal file
74
test/156_eol_control_crlf_design_info.txt
Normal file
@ -0,0 +1,74 @@
|
||||
:DESC
|
||||
Test that the line terminator can be forced to CRLF in the design details output.
|
||||
|
||||
:ENV
|
||||
export BOXES_TEST_XXD=1
|
||||
:ARGS
|
||||
-f ../boxes-config -l -d c -e crlf
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
s/^.*([0-9a-fA-F]{4}):/0000\1:/
|
||||
:EXPECTED
|
||||
00000000: 436f 6d70 6c65 7465 2044 6573 6967 6e20 Complete Design
|
||||
00000010: 496e 666f 726d 6174 696f 6e20 666f 7220 Information for
|
||||
00000020: 2263 223a 0d0a 2d2d 2d2d 2d2d 2d2d 2d2d "c":..----------
|
||||
00000030: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d ----------------
|
||||
00000040: 2d2d 2d2d 2d2d 2d2d 2d2d 0d0a 416c 6961 ----------..Alia
|
||||
00000050: 7320 4e61 6d65 733a 2020 2020 2020 2020 s Names:
|
||||
00000060: 2020 2020 6e6f 6e65 0d0a 4175 7468 6f72 none..Author
|
||||
00000070: 3a20 2020 2020 2020 2020 2020 2020 2020 :
|
||||
00000080: 2020 5468 6f6d 6173 204a 656e 7365 6e0d Thomas Jensen.
|
||||
00000090: 0a4f 7269 6769 6e61 6c20 4465 7369 676e .Original Design
|
||||
000000a0: 6572 3a20 2020 2020 2028 7075 626c 6963 er: (public
|
||||
000000b0: 2064 6f6d 6169 6e29 0d0a 4372 6561 7469 domain)..Creati
|
||||
000000c0: 6f6e 2044 6174 653a 2020 2020 2020 2020 on Date:
|
||||
000000d0: 2020 4d61 7263 6820 3138 2c20 3139 3939 March 18, 1999
|
||||
000000e0: 2028 5468 7572 7364 6179 2c20 3135 3a32 (Thursday, 15:2
|
||||
000000f0: 3568 290d 0a43 7572 7265 6e74 2052 6576 5h)..Current Rev
|
||||
00000100: 6973 696f 6e3a 2020 2020 2020 2031 2e30 ision: 1.0
|
||||
00000110: 2061 7320 6f66 204d 6172 6368 2031 382c as of March 18,
|
||||
00000120: 2031 3939 3920 2854 6875 7273 6461 792c 1999 (Thursday,
|
||||
00000130: 2031 353a 3235 6829 0d0a 436f 6e66 6967 15:25h)..Config
|
||||
00000140: 7572 6174 696f 6e20 4669 6c65 3a20 2020 uration File:
|
||||
00000150: 2020 2e2e 2f62 6f78 6573 2d63 6f6e 6669 ../boxes-confi
|
||||
00000160: 670d 0a49 6e64 656e 7461 7469 6f6e 204d g..Indentation M
|
||||
00000170: 6f64 653a 2020 2020 2020 2062 6f78 2028 ode: box (
|
||||
00000180: 696e 6465 6e74 2062 6f78 290d 0a52 6570 indent box)..Rep
|
||||
00000190: 6c61 6365 6d65 6e74 2052 756c 6573 3a20 lacement Rules:
|
||||
000001a0: 2020 2020 2031 2e20 2867 6c6f 6229 2022 1. (glob) "
|
||||
000001b0: 5c2a 2f22 2057 4954 4820 222a 5c5c 2f22 \*/" WITH "*\\/"
|
||||
000001c0: 0d0a 5265 7665 7273 696f 6e20 5275 6c65 ..Reversion Rule
|
||||
000001d0: 733a 2020 2020 2020 2020 312e 2028 676c s: 1. (gl
|
||||
000001e0: 6f62 2920 225c 2a5c 5c2f 2220 544f 2022 ob) "\*\\/" TO "
|
||||
000001f0: 2a2f 220d 0a4d 696e 696d 756d 2042 6f78 */"..Minimum Box
|
||||
00000200: 2044 696d 656e 7369 6f6e 733a 2035 2078 Dimensions: 5 x
|
||||
00000210: 2033 2020 2877 6964 7468 2078 2068 6569 3 (width x hei
|
||||
00000220: 6768 7429 0d0a 4465 6661 756c 7420 5061 ght)..Default Pa
|
||||
00000230: 6464 696e 673a 2020 2020 2020 2020 6c65 dding: le
|
||||
00000240: 6674 2031 2c20 7269 6768 7420 310d 0a44 ft 1, right 1..D
|
||||
00000250: 6566 6175 6c74 204b 696c 6c62 6c61 6e6b efault Killblank
|
||||
00000260: 3a20 2020 2020 2079 6573 0d0a 5461 6773 : yes..Tags
|
||||
00000270: 3a20 2020 2020 2020 2020 2020 2020 2020 :
|
||||
00000280: 2020 2020 7369 6d70 6c65 2c20 7072 6f67 simple, prog
|
||||
00000290: 7261 6d6d 696e 672c 2062 6f78 0d0a 456c ramming, box..El
|
||||
000002a0: 6173 7469 6320 5368 6170 6573 3a20 2020 astic Shapes:
|
||||
000002b0: 2020 2020 2020 4e2c 2045 2c20 532c 2057 N, E, S, W
|
||||
000002c0: 0d0a 4465 6669 6e65 6420 5368 6170 6573 ..Defined Shapes
|
||||
000002d0: 3a20 2020 2020 2020 2020 204e 573a 2022 : NW: "
|
||||
000002e0: 2f2a 2220 0d0a 2020 2020 2020 2020 2020 /*" ..
|
||||
000002f0: 2020 2020 2020 2020 2020 2020 2020 2020
|
||||
00000300: 4e3a 2022 2a22 200d 0a20 2020 2020 2020 N: "*" ..
|
||||
00000310: 2020 2020 2020 2020 2020 2020 2020 2020
|
||||
00000320: 2020 4e45 3a20 222a 2f22 200d 0a20 2020 NE: "*/" ..
|
||||
00000330: 2020 2020 2020 2020 2020 2020 2020 2020
|
||||
00000340: 2020 2020 2020 2045 3a20 222a 2f22 200d E: "*/" .
|
||||
00000350: 0a20 2020 2020 2020 2020 2020 2020 2020 .
|
||||
00000360: 2020 2020 2020 2020 2020 5345 3a20 222a SE: "*
|
||||
00000370: 2f22 200d 0a20 2020 2020 2020 2020 2020 /" ..
|
||||
00000380: 2020 2020 2020 2020 2020 2020 2020 2053 S
|
||||
00000390: 3a20 222a 2220 0d0a 2020 2020 2020 2020 : "*" ..
|
||||
000003a0: 2020 2020 2020 2020 2020 2020 2020 2020
|
||||
000003b0: 2053 573a 2022 2f2a 2220 0d0a 2020 2020 SW: "/*" ..
|
||||
000003c0: 2020 2020 2020 2020 2020 2020 2020 2020
|
||||
000003d0: 2020 2020 2020 573a 2022 2f2a 2220 0d0a W: "/*" ..
|
||||
:EOF
|
73
test/157_eol_control_lf_design_info.txt
Normal file
73
test/157_eol_control_lf_design_info.txt
Normal file
@ -0,0 +1,73 @@
|
||||
:DESC
|
||||
Test that the line terminator can be forced to LF in the design details output.
|
||||
|
||||
:ENV
|
||||
export BOXES_TEST_XXD=1
|
||||
:ARGS
|
||||
-f ../boxes-config -l -d c -e lf
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
s/^.*([0-9a-fA-F]{4}):/0000\1:/
|
||||
:EXPECTED
|
||||
00000000: 436f 6d70 6c65 7465 2044 6573 6967 6e20 Complete Design
|
||||
00000010: 496e 666f 726d 6174 696f 6e20 666f 7220 Information for
|
||||
00000020: 2263 223a 0a2d 2d2d 2d2d 2d2d 2d2d 2d2d "c":.-----------
|
||||
00000030: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d ----------------
|
||||
00000040: 2d2d 2d2d 2d2d 2d2d 2d0a 416c 6961 7320 ---------.Alias
|
||||
00000050: 4e61 6d65 733a 2020 2020 2020 2020 2020 Names:
|
||||
00000060: 2020 6e6f 6e65 0a41 7574 686f 723a 2020 none.Author:
|
||||
00000070: 2020 2020 2020 2020 2020 2020 2020 2054 T
|
||||
00000080: 686f 6d61 7320 4a65 6e73 656e 0a4f 7269 homas Jensen.Ori
|
||||
00000090: 6769 6e61 6c20 4465 7369 676e 6572 3a20 ginal Designer:
|
||||
000000a0: 2020 2020 2028 7075 626c 6963 2064 6f6d (public dom
|
||||
000000b0: 6169 6e29 0a43 7265 6174 696f 6e20 4461 ain).Creation Da
|
||||
000000c0: 7465 3a20 2020 2020 2020 2020 204d 6172 te: Mar
|
||||
000000d0: 6368 2031 382c 2031 3939 3920 2854 6875 ch 18, 1999 (Thu
|
||||
000000e0: 7273 6461 792c 2031 353a 3235 6829 0a43 rsday, 15:25h).C
|
||||
000000f0: 7572 7265 6e74 2052 6576 6973 696f 6e3a urrent Revision:
|
||||
00000100: 2020 2020 2020 2031 2e30 2061 7320 6f66 1.0 as of
|
||||
00000110: 204d 6172 6368 2031 382c 2031 3939 3920 March 18, 1999
|
||||
00000120: 2854 6875 7273 6461 792c 2031 353a 3235 (Thursday, 15:25
|
||||
00000130: 6829 0a43 6f6e 6669 6775 7261 7469 6f6e h).Configuration
|
||||
00000140: 2046 696c 653a 2020 2020 202e 2e2f 626f File: ../bo
|
||||
00000150: 7865 732d 636f 6e66 6967 0a49 6e64 656e xes-config.Inden
|
||||
00000160: 7461 7469 6f6e 204d 6f64 653a 2020 2020 tation Mode:
|
||||
00000170: 2020 2062 6f78 2028 696e 6465 6e74 2062 box (indent b
|
||||
00000180: 6f78 290a 5265 706c 6163 656d 656e 7420 ox).Replacement
|
||||
00000190: 5275 6c65 733a 2020 2020 2020 312e 2028 Rules: 1. (
|
||||
000001a0: 676c 6f62 2920 225c 2a2f 2220 5749 5448 glob) "\*/" WITH
|
||||
000001b0: 2022 2a5c 5c2f 220a 5265 7665 7273 696f "*\\/".Reversio
|
||||
000001c0: 6e20 5275 6c65 733a 2020 2020 2020 2020 n Rules:
|
||||
000001d0: 312e 2028 676c 6f62 2920 225c 2a5c 5c2f 1. (glob) "\*\\/
|
||||
000001e0: 2220 544f 2022 2a2f 220a 4d69 6e69 6d75 " TO "*/".Minimu
|
||||
000001f0: 6d20 426f 7820 4469 6d65 6e73 696f 6e73 m Box Dimensions
|
||||
00000200: 3a20 3520 7820 3320 2028 7769 6474 6820 : 5 x 3 (width
|
||||
00000210: 7820 6865 6967 6874 290a 4465 6661 756c x height).Defaul
|
||||
00000220: 7420 5061 6464 696e 673a 2020 2020 2020 t Padding:
|
||||
00000230: 2020 6c65 6674 2031 2c20 7269 6768 7420 left 1, right
|
||||
00000240: 310a 4465 6661 756c 7420 4b69 6c6c 626c 1.Default Killbl
|
||||
00000250: 616e 6b3a 2020 2020 2020 7965 730a 5461 ank: yes.Ta
|
||||
00000260: 6773 3a20 2020 2020 2020 2020 2020 2020 gs:
|
||||
00000270: 2020 2020 2020 7369 6d70 6c65 2c20 7072 simple, pr
|
||||
00000280: 6f67 7261 6d6d 696e 672c 2062 6f78 0a45 ogramming, box.E
|
||||
00000290: 6c61 7374 6963 2053 6861 7065 733a 2020 lastic Shapes:
|
||||
000002a0: 2020 2020 2020 204e 2c20 452c 2053 2c20 N, E, S,
|
||||
000002b0: 570a 4465 6669 6e65 6420 5368 6170 6573 W.Defined Shapes
|
||||
000002c0: 3a20 2020 2020 2020 2020 204e 573a 2022 : NW: "
|
||||
000002d0: 2f2a 2220 0a20 2020 2020 2020 2020 2020 /*" .
|
||||
000002e0: 2020 2020 2020 2020 2020 2020 2020 204e N
|
||||
000002f0: 3a20 222a 2220 0a20 2020 2020 2020 2020 : "*" .
|
||||
00000300: 2020 2020 2020 2020 2020 2020 2020 2020
|
||||
00000310: 4e45 3a20 222a 2f22 200a 2020 2020 2020 NE: "*/" .
|
||||
00000320: 2020 2020 2020 2020 2020 2020 2020 2020
|
||||
00000330: 2020 2020 453a 2022 2a2f 2220 0a20 2020 E: "*/" .
|
||||
00000340: 2020 2020 2020 2020 2020 2020 2020 2020
|
||||
00000350: 2020 2020 2020 5345 3a20 222a 2f22 200a SE: "*/" .
|
||||
00000360: 2020 2020 2020 2020 2020 2020 2020 2020
|
||||
00000370: 2020 2020 2020 2020 2020 533a 2022 2a22 S: "*"
|
||||
00000380: 200a 2020 2020 2020 2020 2020 2020 2020 .
|
||||
00000390: 2020 2020 2020 2020 2020 2053 573a 2022 SW: "
|
||||
000003a0: 2f2a 2220 0a20 2020 2020 2020 2020 2020 /*" .
|
||||
000003b0: 2020 2020 2020 2020 2020 2020 2020 2057 W
|
||||
000003c0: 3a20 222f 2a22 200a : "/*" .
|
||||
:EOF
|
17
test/158_eol_control_crlf_remove.txt
Normal file
17
test/158_eol_control_crlf_remove.txt
Normal file
@ -0,0 +1,17 @@
|
||||
:DESC
|
||||
Test that the line terminator can be forced to CRLF on box removal.
|
||||
|
||||
:ENV
|
||||
export BOXES_TEST_XXD=1
|
||||
:ARGS
|
||||
-f ../boxes-config -d c -e crlf -r
|
||||
:INPUT
|
||||
/*******/
|
||||
/* foo */
|
||||
/* bar */
|
||||
/*******/
|
||||
:OUTPUT-FILTER
|
||||
s/^.*([0-9a-fA-F]{4}):/0000\1:/
|
||||
:EXPECTED
|
||||
00000000: 666f 6f0d 0a62 6172 0d0a foo..bar..
|
||||
:EOF
|
17
test/159_eol_control_lf_remove.txt
Normal file
17
test/159_eol_control_lf_remove.txt
Normal file
@ -0,0 +1,17 @@
|
||||
:DESC
|
||||
Test that the line terminator can be forced to LF on box removal.
|
||||
|
||||
:ENV
|
||||
export BOXES_TEST_XXD=1
|
||||
:ARGS
|
||||
-f ../boxes-config -d c -e lf -r
|
||||
:INPUT
|
||||
/*******/
|
||||
/* foo */
|
||||
/* bar */
|
||||
/*******/
|
||||
:OUTPUT-FILTER
|
||||
s/^.*([0-9a-fA-F]{4}):/0000\1:/
|
||||
:EXPECTED
|
||||
00000000: 666f 6f0a 6261 720a foo.bar.
|
||||
:EOF
|
102
test/160_list_designs_author_designer.cfg
Normal file
102
test/160_list_designs_author_designer.cfg
Normal file
@ -0,0 +1,102 @@
|
||||
BOX designA
|
||||
|
||||
author "authorA"
|
||||
designer "designerA"
|
||||
|
||||
sample
|
||||
AAA
|
||||
AAA foo
|
||||
AAA
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("AAA", "AAA", "AAA")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designA
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designB
|
||||
|
||||
author "authorB"
|
||||
|
||||
sample
|
||||
BBB
|
||||
BBB foo
|
||||
BBB
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("BBB", "BBB", "BBB")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designB
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designC
|
||||
|
||||
designer "designerC"
|
||||
|
||||
sample
|
||||
CCC
|
||||
CCC foo
|
||||
CCC
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("CCC", "CCC", "CCC")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designC
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designD
|
||||
|
||||
# no author or designer
|
||||
|
||||
sample
|
||||
DDD
|
||||
DDD foo
|
||||
DDD
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("DDD", "DDD", "DDD")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designD
|
40
test/160_list_designs_author_designer.txt
Normal file
40
test/160_list_designs_author_designer.txt
Normal file
@ -0,0 +1,40 @@
|
||||
:ARGS
|
||||
-f 160_list_designs_author_designer.cfg -l
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
4 Available Styles in "160_list_designs_author_designer.cfg":
|
||||
-------------------------------------------------------------
|
||||
|
||||
designA
|
||||
designerA, coded by authorA:
|
||||
|
||||
AAA
|
||||
AAA foo
|
||||
AAA
|
||||
|
||||
|
||||
designB
|
||||
unknown artist, coded by authorB:
|
||||
|
||||
BBB
|
||||
BBB foo
|
||||
BBB
|
||||
|
||||
|
||||
designC
|
||||
designerC:
|
||||
|
||||
CCC
|
||||
CCC foo
|
||||
CCC
|
||||
|
||||
|
||||
designD:
|
||||
|
||||
DDD
|
||||
DDD foo
|
||||
DDD
|
||||
|
||||
|
||||
:EOF
|
106
test/161_eol_control_list_designs_crlf.cfg
Normal file
106
test/161_eol_control_list_designs_crlf.cfg
Normal file
@ -0,0 +1,106 @@
|
||||
BOX designA
|
||||
|
||||
author "authorA"
|
||||
designer "designerA"
|
||||
|
||||
sample
|
||||
AAA
|
||||
AAA foo
|
||||
AAA
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("AAA", "AAA", "AAA")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designA
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designB
|
||||
|
||||
author "authorB"
|
||||
|
||||
tags ("tag1")
|
||||
|
||||
sample
|
||||
BBB
|
||||
BBB foo
|
||||
BBB
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("BBB", "BBB", "BBB")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designB
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designC
|
||||
|
||||
designer "designerC"
|
||||
|
||||
tags ("tag1", "tag2")
|
||||
|
||||
sample
|
||||
CCC
|
||||
CCC foo
|
||||
CCC
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("CCC", "CCC", "CCC")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designC
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designD
|
||||
|
||||
# no author or designer
|
||||
|
||||
sample
|
||||
DDD
|
||||
DDD foo
|
||||
DDD
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("DDD", "DDD", "DDD")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designD
|
35
test/161_eol_control_list_designs_crlf.txt
Normal file
35
test/161_eol_control_list_designs_crlf.txt
Normal file
@ -0,0 +1,35 @@
|
||||
:ENV
|
||||
export BOXES_TEST_XXD=1
|
||||
:ARGS
|
||||
-f 161_eol_control_list_designs_crlf.cfg -l -e CRlf
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
s/^.*([0-9a-fA-F]{4}):/0000\1:/
|
||||
:EXPECTED
|
||||
00000000: 3420 4176 6169 6c61 626c 6520 5374 796c 4 Available Styl
|
||||
00000010: 6573 2069 6e20 2231 3631 5f65 6f6c 5f63 es in "161_eol_c
|
||||
00000020: 6f6e 7472 6f6c 5f6c 6973 745f 6465 7369 ontrol_list_desi
|
||||
00000030: 676e 735f 6372 6c66 2e63 6667 223a 0d0a gns_crlf.cfg":..
|
||||
00000040: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d ----------------
|
||||
00000050: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d ----------------
|
||||
00000060: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d ----------------
|
||||
00000070: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 0d0a --------------..
|
||||
00000080: 0d0a 6465 7369 676e 410d 0a64 6573 6967 ..designA..desig
|
||||
00000090: 6e65 7241 2c20 636f 6465 6420 6279 2061 nerA, coded by a
|
||||
000000a0: 7574 686f 7241 3a0d 0a0d 0a20 2020 2041 uthorA:.... A
|
||||
000000b0: 4141 0d0a 2020 2020 4141 4120 666f 6f0d AA.. AAA foo.
|
||||
000000c0: 0a20 2020 2041 4141 0d0a 0d0a 0d0a 6465 . AAA......de
|
||||
000000d0: 7369 676e 420d 0a75 6e6b 6e6f 776e 2061 signB..unknown a
|
||||
000000e0: 7274 6973 742c 2063 6f64 6564 2062 7920 rtist, coded by
|
||||
000000f0: 6175 7468 6f72 423a 0d0a 0d0a 2020 2020 authorB:....
|
||||
00000100: 4242 420d 0a20 2020 2042 4242 2066 6f6f BBB.. BBB foo
|
||||
00000110: 0d0a 2020 2020 4242 420d 0a0d 0a0d 0a64 .. BBB......d
|
||||
00000120: 6573 6967 6e43 0d0a 6465 7369 676e 6572 esignC..designer
|
||||
00000130: 433a 0d0a 0d0a 2020 2020 4343 430d 0a20 C:.... CCC..
|
||||
00000140: 2020 2043 4343 2066 6f6f 0d0a 2020 2020 CCC foo..
|
||||
00000150: 4343 430d 0a0d 0a0d 0a64 6573 6967 6e44 CCC......designD
|
||||
00000160: 3a0d 0a0d 0a20 2020 2044 4444 0d0a 2020 :.... DDD..
|
||||
00000170: 2020 4444 4420 666f 6f0d 0a20 2020 2044 DDD foo.. D
|
||||
00000180: 4444 0d0a 0d0a 0d0a 7461 6731 2028 3229 DD......tag1 (2)
|
||||
00000190: 207c 2074 6167 3220 2831 290d 0a | tag2 (1)..
|
||||
:EOF
|
106
test/162_eol_control_list_designs_lf.cfg
Normal file
106
test/162_eol_control_list_designs_lf.cfg
Normal file
@ -0,0 +1,106 @@
|
||||
BOX designA
|
||||
|
||||
author "authorA"
|
||||
designer "designerA"
|
||||
|
||||
sample
|
||||
AAA
|
||||
AAA foo
|
||||
AAA
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("AAA", "AAA", "AAA")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designA
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designB
|
||||
|
||||
author "authorB"
|
||||
|
||||
tags ("tag1")
|
||||
|
||||
sample
|
||||
BBB
|
||||
BBB foo
|
||||
BBB
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("BBB", "BBB", "BBB")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designB
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designC
|
||||
|
||||
designer "designerC"
|
||||
|
||||
tags ("tag1", "tag2")
|
||||
|
||||
sample
|
||||
CCC
|
||||
CCC foo
|
||||
CCC
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("CCC", "CCC", "CCC")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designC
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designD
|
||||
|
||||
# no author or designer
|
||||
|
||||
sample
|
||||
DDD
|
||||
DDD foo
|
||||
DDD
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("DDD", "DDD", "DDD")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designD
|
33
test/162_eol_control_list_designs_lf.txt
Normal file
33
test/162_eol_control_list_designs_lf.txt
Normal file
@ -0,0 +1,33 @@
|
||||
:ENV
|
||||
export BOXES_TEST_XXD=1
|
||||
:ARGS
|
||||
-f 162_eol_control_list_designs_lf.cfg -l -e lf
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
s/^.*([0-9a-fA-F]{4}):/0000\1:/
|
||||
:EXPECTED
|
||||
00000000: 3420 4176 6169 6c61 626c 6520 5374 796c 4 Available Styl
|
||||
00000010: 6573 2069 6e20 2231 3632 5f65 6f6c 5f63 es in "162_eol_c
|
||||
00000020: 6f6e 7472 6f6c 5f6c 6973 745f 6465 7369 ontrol_list_desi
|
||||
00000030: 676e 735f 6c66 2e63 6667 223a 0a2d 2d2d gns_lf.cfg":.---
|
||||
00000040: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d ----------------
|
||||
00000050: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d ----------------
|
||||
00000060: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d ----------------
|
||||
00000070: 2d2d 2d2d 2d2d 2d2d 2d0a 0a64 6573 6967 ---------..desig
|
||||
00000080: 6e41 0a64 6573 6967 6e65 7241 2c20 636f nA.designerA, co
|
||||
00000090: 6465 6420 6279 2061 7574 686f 7241 3a0a ded by authorA:.
|
||||
000000a0: 0a20 2020 2041 4141 0a20 2020 2041 4141 . AAA. AAA
|
||||
000000b0: 2066 6f6f 0a20 2020 2041 4141 0a0a 0a64 foo. AAA...d
|
||||
000000c0: 6573 6967 6e42 0a75 6e6b 6e6f 776e 2061 esignB.unknown a
|
||||
000000d0: 7274 6973 742c 2063 6f64 6564 2062 7920 rtist, coded by
|
||||
000000e0: 6175 7468 6f72 423a 0a0a 2020 2020 4242 authorB:.. BB
|
||||
000000f0: 420a 2020 2020 4242 4220 666f 6f0a 2020 B. BBB foo.
|
||||
00000100: 2020 4242 420a 0a0a 6465 7369 676e 430a BBB...designC.
|
||||
00000110: 6465 7369 676e 6572 433a 0a0a 2020 2020 designerC:..
|
||||
00000120: 4343 430a 2020 2020 4343 4320 666f 6f0a CCC. CCC foo.
|
||||
00000130: 2020 2020 4343 430a 0a0a 6465 7369 676e CCC...design
|
||||
00000140: 443a 0a0a 2020 2020 4444 440a 2020 2020 D:.. DDD.
|
||||
00000150: 4444 4420 666f 6f0a 2020 2020 4444 440a DDD foo. DDD.
|
||||
00000160: 0a0a 7461 6731 2028 3229 207c 2074 6167 ..tag1 (2) | tag
|
||||
00000170: 3220 2831 290a 2 (1).
|
||||
:EOF
|
@ -93,7 +93,11 @@ else
|
||||
fi
|
||||
|
||||
echo " Invoking: $(basename $boxesBinary) $boxesArgs"
|
||||
cat $testInputFile | $boxesBinary $boxesArgs >$testOutputFile 2>&1
|
||||
if [ ! -z "$BOXES_TEST_XXD" ]; then
|
||||
cat $testInputFile | $boxesBinary $boxesArgs | xxd >$testOutputFile 2>&1
|
||||
else
|
||||
cat $testInputFile | $boxesBinary $boxesArgs >$testOutputFile 2>&1
|
||||
fi
|
||||
declare -ir actualReturnCode=$?
|
||||
cat $testOutputFile | tr -d '\r' | sed -E -f $testFilterFile | diff - $testExpectationFile
|
||||
if [ $? -ne 0 ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user