mirror of
https://github.com/ascii-boxes/boxes.git
synced 2024-12-12 09:51:10 +01:00
Add tests for tag handling #23
This commit is contained in:
parent
542e6bd4dd
commit
f93639f1e4
12
test/140_tag_query_normal.txt
Normal file
12
test/140_tag_query_normal.txt
Normal file
@ -0,0 +1,12 @@
|
||||
:ARGS
|
||||
-f 14x_tag_query.cfg -l -q tag1,tag2
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
designA
|
||||
aliasA1 (alias)
|
||||
designB
|
||||
aliasB1 (alias)
|
||||
aliasB2 (alias)
|
||||
designC
|
||||
:EOF
|
9
test/141_tag_query_plus.txt
Normal file
9
test/141_tag_query_plus.txt
Normal file
@ -0,0 +1,9 @@
|
||||
:ARGS
|
||||
-f 14x_tag_query.cfg -l -q +tag1,tag2
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
designA
|
||||
aliasA1 (alias)
|
||||
designC
|
||||
:EOF
|
8
test/142_tag_query_plus2.txt
Normal file
8
test/142_tag_query_plus2.txt
Normal file
@ -0,0 +1,8 @@
|
||||
:ARGS
|
||||
-f 14x_tag_query.cfg -l -q +tag1,+tag3
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
designA
|
||||
aliasA1 (alias)
|
||||
:EOF
|
10
test/143_tag_query_minus.txt
Normal file
10
test/143_tag_query_minus.txt
Normal file
@ -0,0 +1,10 @@
|
||||
:ARGS
|
||||
-f 14x_tag_query.cfg -l -q -tag1
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
designB
|
||||
aliasB1 (alias)
|
||||
aliasB2 (alias)
|
||||
designD
|
||||
:EOF
|
7
test/144_tag_query_minus2.txt
Normal file
7
test/144_tag_query_minus2.txt
Normal file
@ -0,0 +1,7 @@
|
||||
:ARGS
|
||||
-f 14x_tag_query.cfg -l -q -tag1,-tag2
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
designD
|
||||
:EOF
|
13
test/145_tag_query_all.txt
Normal file
13
test/145_tag_query_all.txt
Normal file
@ -0,0 +1,13 @@
|
||||
:ARGS
|
||||
-f 14x_tag_query.cfg -l -q (all)
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
designA
|
||||
aliasA1 (alias)
|
||||
designB
|
||||
aliasB1 (alias)
|
||||
aliasB2 (alias)
|
||||
designC
|
||||
designD
|
||||
:EOF
|
7
test/146_tag_query_invalid.txt
Normal file
7
test/146_tag_query_invalid.txt
Normal file
@ -0,0 +1,7 @@
|
||||
:ARGS
|
||||
-f 146_tag_query.cfg -l -q INVALID
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED-ERROR 1
|
||||
boxes: not a tag -- INVALID
|
||||
:EOF
|
38
test/147_tag_stats_list.txt
Normal file
38
test/147_tag_stats_list.txt
Normal file
@ -0,0 +1,38 @@
|
||||
:ARGS
|
||||
-f 14x_tag_query.cfg -l
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
4 Available Styles in "14x_tag_query.cfg":
|
||||
------------------------------------------
|
||||
|
||||
designA alias aliasA1:
|
||||
|
||||
AAA
|
||||
AAA foo
|
||||
AAA
|
||||
|
||||
|
||||
designB alias aliasB1, aliasB2:
|
||||
|
||||
BBB
|
||||
BBB foo
|
||||
BBB
|
||||
|
||||
|
||||
designC:
|
||||
|
||||
CCC
|
||||
CCC foo
|
||||
CCC
|
||||
|
||||
|
||||
designD:
|
||||
|
||||
DDD
|
||||
DDD foo
|
||||
DDD
|
||||
|
||||
|
||||
tag1 (2) | tag2 (3) | tag3 (3)
|
||||
:EOF
|
7
test/148_tag_query_duplicate_expression.txt
Normal file
7
test/148_tag_query_duplicate_expression.txt
Normal file
@ -0,0 +1,7 @@
|
||||
:ARGS
|
||||
-f 14x_tag_query.cfg -l -q -tag1,+tag1
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED-ERROR 1
|
||||
boxes: duplicate query expression -- +tag1
|
||||
:EOF
|
7
test/149_tag_query_duplicate_expression2.txt
Normal file
7
test/149_tag_query_duplicate_expression2.txt
Normal file
@ -0,0 +1,7 @@
|
||||
:ARGS
|
||||
-f 14x_tag_query.cfg -l -q -tag1,tag1
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED-ERROR 1
|
||||
boxes: duplicate query expression -- tag1
|
||||
:EOF
|
103
test/14x_tag_query.cfg
Normal file
103
test/14x_tag_query.cfg
Normal file
@ -0,0 +1,103 @@
|
||||
BOX designA, aliasA1
|
||||
|
||||
tags ("tag1", "tag2", "tag3")
|
||||
|
||||
sample
|
||||
AAA
|
||||
AAA foo
|
||||
AAA
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("AAA", "AAA", "AAA")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designA
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designB, aliasB1, aliasB2
|
||||
|
||||
tags ("tag2 ",
|
||||
" tag3")
|
||||
|
||||
sample
|
||||
BBB
|
||||
BBB foo
|
||||
BBB
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("BBB", "BBB", "BBB")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designB
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designC
|
||||
|
||||
tags (" tag1 ",
|
||||
"tag2 ")
|
||||
|
||||
sample
|
||||
CCC
|
||||
CCC foo
|
||||
CCC
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("CCC", "CCC", "CCC")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designC
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designD
|
||||
|
||||
tags "tag3"
|
||||
|
||||
sample
|
||||
DDD
|
||||
DDD foo
|
||||
DDD
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("DDD", "DDD", "DDD")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designD
|
79
test/150_tag_config_invalid_tags.cfg
Normal file
79
test/150_tag_config_invalid_tags.cfg
Normal file
@ -0,0 +1,79 @@
|
||||
BOX designA
|
||||
|
||||
tags ("tag1")
|
||||
tags ("tag2", "tag3")
|
||||
tags "tag4 , tag5"
|
||||
tags "tag6"
|
||||
|
||||
sample
|
||||
AAA
|
||||
AAA foo
|
||||
AAA
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("AAA", "AAA", "AAA")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designA
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designB
|
||||
|
||||
tags "Invalid1, 2invalid, invalid3-, -invalid4, in--valid5"
|
||||
tags ("in space valid6")
|
||||
|
||||
sample
|
||||
BBB
|
||||
BBB foo
|
||||
BBB
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("BBB", "BBB", "BBB")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designB
|
||||
|
||||
# -------------------------------------------------------
|
||||
|
||||
BOX designC
|
||||
|
||||
tags ("in space valid7")
|
||||
|
||||
sample
|
||||
CCC
|
||||
CCC foo
|
||||
CCC
|
||||
ends
|
||||
|
||||
shapes {
|
||||
w ("CCC", "CCC", "CCC")
|
||||
}
|
||||
|
||||
elastic (
|
||||
w
|
||||
)
|
||||
|
||||
padding {
|
||||
left 1
|
||||
}
|
||||
|
||||
END designC
|
38
test/150_tag_config_invalid_tags.txt
Normal file
38
test/150_tag_config_invalid_tags.txt
Normal file
@ -0,0 +1,38 @@
|
||||
:ARGS
|
||||
-f 150_tag_config_invalid_tags.cfg -l
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
boxes: 150_tag_config_invalid_tags.cfg: line 32: invalid tag -- Invalid1
|
||||
boxes: 150_tag_config_invalid_tags.cfg: line 32: invalid tag -- 2invalid
|
||||
boxes: 150_tag_config_invalid_tags.cfg: line 32: invalid tag -- invalid3-
|
||||
boxes: 150_tag_config_invalid_tags.cfg: line 32: invalid tag -- -invalid4
|
||||
boxes: 150_tag_config_invalid_tags.cfg: line 32: invalid tag -- in--valid5
|
||||
boxes: 150_tag_config_invalid_tags.cfg: line 33: invalid tag -- in space valid6
|
||||
boxes: 150_tag_config_invalid_tags.cfg: line 59: invalid tag -- in space valid7
|
||||
3 Available Styles in "150_tag_config_invalid_tags.cfg":
|
||||
--------------------------------------------------------
|
||||
|
||||
designA:
|
||||
|
||||
AAA
|
||||
AAA foo
|
||||
AAA
|
||||
|
||||
|
||||
designB:
|
||||
|
||||
BBB
|
||||
BBB foo
|
||||
BBB
|
||||
|
||||
|
||||
designC:
|
||||
|
||||
CCC
|
||||
CCC foo
|
||||
CCC
|
||||
|
||||
|
||||
tag1 (1) | tag2 (1) | tag3 (1) | tag4 (1) | tag5 (1) | tag6 (1)
|
||||
:EOF
|
6
test/151_tag_query_empty.txt
Normal file
6
test/151_tag_query_empty.txt
Normal file
@ -0,0 +1,6 @@
|
||||
:ARGS
|
||||
-f 14x_tag_query.cfg -l -q non-existent
|
||||
:INPUT
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
:EOF
|
Loading…
Reference in New Issue
Block a user