diff --git a/test/140_tag_query_normal.txt b/test/140_tag_query_normal.txt new file mode 100644 index 0000000..32acb05 --- /dev/null +++ b/test/140_tag_query_normal.txt @@ -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 diff --git a/test/141_tag_query_plus.txt b/test/141_tag_query_plus.txt new file mode 100644 index 0000000..1348f3b --- /dev/null +++ b/test/141_tag_query_plus.txt @@ -0,0 +1,9 @@ +:ARGS +-f 14x_tag_query.cfg -l -q +tag1,tag2 +:INPUT +:OUTPUT-FILTER +:EXPECTED +designA +aliasA1 (alias) +designC +:EOF diff --git a/test/142_tag_query_plus2.txt b/test/142_tag_query_plus2.txt new file mode 100644 index 0000000..bb90fa5 --- /dev/null +++ b/test/142_tag_query_plus2.txt @@ -0,0 +1,8 @@ +:ARGS +-f 14x_tag_query.cfg -l -q +tag1,+tag3 +:INPUT +:OUTPUT-FILTER +:EXPECTED +designA +aliasA1 (alias) +:EOF diff --git a/test/143_tag_query_minus.txt b/test/143_tag_query_minus.txt new file mode 100644 index 0000000..94c28e2 --- /dev/null +++ b/test/143_tag_query_minus.txt @@ -0,0 +1,10 @@ +:ARGS +-f 14x_tag_query.cfg -l -q -tag1 +:INPUT +:OUTPUT-FILTER +:EXPECTED +designB +aliasB1 (alias) +aliasB2 (alias) +designD +:EOF diff --git a/test/144_tag_query_minus2.txt b/test/144_tag_query_minus2.txt new file mode 100644 index 0000000..3e613d4 --- /dev/null +++ b/test/144_tag_query_minus2.txt @@ -0,0 +1,7 @@ +:ARGS +-f 14x_tag_query.cfg -l -q -tag1,-tag2 +:INPUT +:OUTPUT-FILTER +:EXPECTED +designD +:EOF diff --git a/test/145_tag_query_all.txt b/test/145_tag_query_all.txt new file mode 100644 index 0000000..3b6d672 --- /dev/null +++ b/test/145_tag_query_all.txt @@ -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 diff --git a/test/146_tag_query_invalid.txt b/test/146_tag_query_invalid.txt new file mode 100644 index 0000000..df4a769 --- /dev/null +++ b/test/146_tag_query_invalid.txt @@ -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 diff --git a/test/147_tag_stats_list.txt b/test/147_tag_stats_list.txt new file mode 100644 index 0000000..05c3c3b --- /dev/null +++ b/test/147_tag_stats_list.txt @@ -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 diff --git a/test/148_tag_query_duplicate_expression.txt b/test/148_tag_query_duplicate_expression.txt new file mode 100644 index 0000000..d0418e3 --- /dev/null +++ b/test/148_tag_query_duplicate_expression.txt @@ -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 diff --git a/test/149_tag_query_duplicate_expression2.txt b/test/149_tag_query_duplicate_expression2.txt new file mode 100644 index 0000000..e60516a --- /dev/null +++ b/test/149_tag_query_duplicate_expression2.txt @@ -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 diff --git a/test/14x_tag_query.cfg b/test/14x_tag_query.cfg new file mode 100644 index 0000000..af77208 --- /dev/null +++ b/test/14x_tag_query.cfg @@ -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 diff --git a/test/150_tag_config_invalid_tags.cfg b/test/150_tag_config_invalid_tags.cfg new file mode 100644 index 0000000..5345b39 --- /dev/null +++ b/test/150_tag_config_invalid_tags.cfg @@ -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 diff --git a/test/150_tag_config_invalid_tags.txt b/test/150_tag_config_invalid_tags.txt new file mode 100644 index 0000000..c559888 --- /dev/null +++ b/test/150_tag_config_invalid_tags.txt @@ -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 diff --git a/test/151_tag_query_empty.txt b/test/151_tag_query_empty.txt new file mode 100644 index 0000000..18026f8 --- /dev/null +++ b/test/151_tag_query_empty.txt @@ -0,0 +1,6 @@ +:ARGS +-f 14x_tag_query.cfg -l -q non-existent +:INPUT +:OUTPUT-FILTER +:EXPECTED +:EOF