Added some test cases for size option

This commit is contained in:
Thomas Jensen 2014-09-28 22:34:26 +02:00
parent 3a50173447
commit b8f0f6fc2c
25 changed files with 313 additions and 0 deletions

View File

@ -0,0 +1,3 @@
../src/boxes: option requires an argument -- 's'
Usage: boxes [options] [infile [outfile]]
Try `boxes -h' for more information.

View File

@ -0,0 +1,3 @@
c:\Users\Thomas\Projects\boxes\src\boxes.exe: option requires an argument -- s
Usage: boxes [options] [infile [outfile]]
Try `boxes -h' for more information.

18
test/053_size_25x10.txt Normal file
View File

@ -0,0 +1,18 @@
:ARGS
-s 25x10
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/***********************/
/* aaa */
/* bbbb */
/* ccccc */
/* */
/* */
/* */
/* */
/* */
/***********************/
:EOF

View File

@ -0,0 +1,14 @@
Size takes precedence over padding, left padding is killed first
:ARGS
-s 10x5
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/********/
/*aaa */
/*bbbb */
/*ccccc */
/********/
:EOF

View File

@ -0,0 +1,14 @@
Size takes precedence over padding
:ARGS
-s 9x5
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/*******/
/*aaa */
/*bbbb */
/*ccccc*/
/*******/
:EOF

View File

@ -0,0 +1,14 @@
Input length takes precedence over size option
:ARGS
-s 2x2 -p a2
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/*******/
/*aaa */
/*bbbb */
/*ccccc*/
/*******/
:EOF

View File

@ -0,0 +1,14 @@
:ARGS
-p v1h10 -s 30x6
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/****************************/
/* aaa */
/* bbbb */
/* ccccc */
/* */
/****************************/
:EOF

View File

@ -0,0 +1,24 @@
:ARGS
-d diamonds -s 15x7
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/\ /\ /\
/\//\\/\ /\//\\/\ /\//\\/\
/\//\\\///\\/\//\\\///\\/\//\\\///\\/\
//\\\//\/\\///\\\//\/\\///\\\//\/\\///\\
\\//\/aaa \/\\//
\/ bbbb \/
/\ ccccc /\
//\\ //\\
\\// \\//
\/ \/
/\ /\
//\\/\ /\//\\
\\///\\/\//\\\///\\/\//\\\///\\/\//\\\//
\/\\///\\\//\/\\///\\\//\/\\///\\\//\/
\/\\//\/ \/\\//\/ \/\\//\/
\/ \/ \/
:EOF

View File

@ -0,0 +1,24 @@
:ARGS
-d diamonds -s 40x16
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/\ /\ /\
/\//\\/\ /\//\\/\ /\//\\/\
/\//\\\///\\/\//\\\///\\/\//\\\///\\/\
//\\\//\/\\///\\\//\/\\///\\\//\/\\///\\
\\//\/aaa \/\\//
\/ bbbb \/
/\ ccccc /\
//\\ //\\
\\// \\//
\/ \/
/\ /\
//\\/\ /\//\\
\\///\\/\//\\\///\\/\//\\\///\\/\//\\\//
\/\\///\\\//\/\\///\\\//\/\\///\\\//\/
\/\\//\/ \/\\//\/ \/\\//\/
\/ \/ \/
:EOF

View File

@ -0,0 +1,28 @@
:ARGS
-d diamonds -s 40x17
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/\ /\ /\
/\//\\/\ /\//\\/\ /\//\\/\
/\//\\\///\\/\//\\\///\\/\//\\\///\\/\
//\\\//\/\\///\\\//\/\\///\\\//\/\\///\\
\\//\/aaa \/\\//
\/ bbbb \/
/\ ccccc /\
//\\ //\\
\\// \\//
\/ \/
/\ /\
//\\ //\\
\\// \\//
\/ \/
/\ /\
//\\/\ /\//\\
\\///\\/\//\\\///\\/\//\\\///\\/\//\\\//
\/\\///\\\//\/\\///\\\//\/\\///\\\//\/
\/\\//\/ \/\\//\/ \/\\//\/
\/ \/ \/
:EOF

View File

@ -0,0 +1,28 @@
:ARGS
-d diamonds -s 41x17
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/\ /\ /\ /\
/\//\\/\ /\//\\/\ /\//\\/\ /\//\\/\
/\//\\\///\\/\//\\\///\\/\//\\\///\\/\//\\\///\\/\
//\\\//\/\\///\\\//\/\\///\\\//\/\\///\\\//\/\\///\\
\\//\/aaa \/\\//
\/ bbbb \/
/\ ccccc /\
//\\ //\\
\\// \\//
\/ \/
/\ /\
//\\ //\\
\\// \\//
\/ \/
/\ /\
//\\/\ /\//\\
\\///\\/\//\\\///\\/\//\\\///\\/\//\\\///\\/\//\\\//
\/\\///\\\//\/\\///\\\//\/\\///\\\//\/\\///\\\//\/
\/\\//\/ \/\\//\/ \/\\//\/ \/\\//\/
\/ \/ \/ \/
:EOF

View File

@ -0,0 +1,15 @@
:ARGS
-s 15x7
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/*************/
/* aaa */
/* bbbb */
/* ccccc */
/* */
/* */
/*************/
:EOF

View File

@ -0,0 +1,15 @@
:ARGS
-s 15x7 -p l2
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/*************/
/* aaa */
/* bbbb */
/* ccccc */
/* */
/* */
/*************/
:EOF

View File

@ -0,0 +1,15 @@
:ARGS
-s 15x7 -p l10
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/*************/
/* aaa */
/* bbbb */
/* ccccc*/
/* */
/* */
/*************/
:EOF

View File

@ -0,0 +1,3 @@
..\src\boxes: option requires an argument -- 's'
Usage: boxes [options] [infile [outfile]]
Try `boxes -h' for more information.

View File

@ -0,0 +1 @@
foo

View File

@ -0,0 +1,3 @@
c:\Users\Thomas\Projects\boxes\src\boxes.exe: option requires an argument -- s
Usage: boxes [options] [infile [outfile]]
Try `boxes -h' for more information.

View File

@ -0,0 +1,9 @@
:ARGS
-s
:INPUT
foo
:EXPECTED-ERROR 1
..\src\boxes: option requires an argument -- 's'
Usage: boxes [options] [infile [outfile]]
Try `boxes -h' for more information.
:EOF

View File

@ -0,0 +1,7 @@
:ARGS
-s -2x3
:INPUT
foo
:EXPECTED-ERROR 1
boxes: invalid box size specification -- -2x3
:EOF

View File

@ -0,0 +1,13 @@
:ARGS
-s 0x1
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/*********/
/* aaa */
/* bbbb */
/* ccccc */
/*********/
:EOF

View File

@ -0,0 +1,13 @@
:ARGS
-s 15
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/*************/
/* aaa */
/* bbbb */
/* ccccc */
/*************/
:EOF

View File

@ -0,0 +1,15 @@
:ARGS
-s x7
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/*********/
/* aaa */
/* bbbb */
/* ccccc */
/* */
/* */
/*********/
:EOF

View File

@ -0,0 +1,13 @@
:ARGS
-s 1x0
:INPUT
aaa
bbbb
ccccc
:EXPECTED
/*******/
/*aaa */
/*bbbb */
/*ccccc*/
/*******/
:EOF

View File

@ -0,0 +1,7 @@
:ARGS
-s 0x0
:INPUT
foo
:EXPECTED-ERROR 1
boxes: invalid box size specification -- 0x0
:EOF