diff --git a/t/basic-xticlabels-domain.ref b/t/basic-xticlabels-domain.ref new file mode 100644 index 0000000..aef60f4 --- /dev/null +++ b/t/basic-xticlabels-domain.ref @@ -0,0 +1,39 @@ + 5 +-------------------------------------------------------------------------------------------+ + | + + * + * + | + | * * | + | * * | + | * * | + | * * | + | * * | + 4 |-+ ############# +-| + | # # | + | # # | + | # # | + | # # | + | # # | + | # # | + 3 |-+ ************* # # +-| + | * * # # | + | * * # # | + | * * # # | + | * * # # | + | * * # # | + | * * # # | + | * * # # | + 2 |-+ ***********############# # #*********** +-| + | * # # # # * | + | * # # # # * | + | * # # # # * | + | * # # # # * | + | * # # # # * | + | * # # # # * | + 1 |-+ ############ # # ############ +-| + | # # # # # # | + | # # # # # # | + | # # # # # # | + | # # # # # # | + | # # # # # # | + | # + # + # # + # + # | + 0 +-------------------------------------------------------------------------------------------+ + aaa bbb ccc ddd + diff --git a/t/basic-xticlabels-no-domain.ref b/t/basic-xticlabels-no-domain.ref new file mode 100644 index 0000000..86b9048 --- /dev/null +++ b/t/basic-xticlabels-no-domain.ref @@ -0,0 +1,39 @@ + 5 +-------------------------------------------------------------------------------------------+ + | + + * + * + | + | * * | + | * * | + | * * | + | * * | + | * * | + 4 |-+ ################### +-| + | # # | + | # # | + | # # | + | # # | + | # # | + | # # | + 3 |-+ ******************# # +-| + | * # # | + | * # # | + | * # # | + | * # # | + | * # # | + | * # # | + | * # # | + 2 |-+ *******************################### #******************* +-| + | * # # # * | + | * # # # * | + | * # # # * | + | * # # # * | + | * # # # * | + | * # # # * | + 1 |-+ #################### # #################### +-| + | # # # # # | + | # # # # # | + | # # # # # | + | # # # # # | + | # # # # # | + | # + # + # + # + # | + 0 +-------------------------------------------------------------------------------------------+ + aaa bbb ccc ddd + diff --git a/t/plots.t b/t/plots.t index 8b8b287..9612b10 100644 --- a/t/plots.t +++ b/t/plots.t @@ -39,7 +39,7 @@ BEGIN { } } -use Test::More tests => 60; +use Test::More tests => 82; use File::Temp 'tempfile'; use IPC::Run 'run'; use String::ShellQuote; @@ -221,6 +221,63 @@ tryplot( testname => 'timefmt with vnl with style', '--style', 'b', 'with lines lt 5' ], refplot => 'timefmt-with-vnl-with-style.ref' ); +my $data_xticlabels = < 'basic xticlabels no domain', + cmd => qq{echo "$data_xticlabels" | vnl-filter -p label,a,b}, + options => ['--vnl', + '--xticlabels', + '--with', 'boxes fill solid border lt -1', + '--ymin', '0'], + refplot => 'basic-xticlabels-no-domain.ref' ); + +tryplot( testname => 'basic xticlabels domain', + cmd => qq{echo "$data_xticlabels"}, + options => [qw(--vnl --domain), + '--xticlabels', + '--with', 'boxes fill solid border lt -1', + '--ymin', '0'], + refplot => 'basic-xticlabels-domain.ref' ); + +tryplot( testname => 'xticlabels clustered', + cmd => qq{echo "$data_xticlabels" | vnl-filter -p label,a,b}, + options => [qw(--vnl), + '--xticlabels', + '--set', 'style data histogram', + '--set', 'style histogram cluster gap 2', + '--set', 'style fill solid border lt -1', + '--ymin', '0'], + refplot => 'xticlabels-clustered.ref' ); + +tryplot( testname => 'xticlabels styles', + cmd => qq{echo "$data_xticlabels"}, + options => [qw(--vnl --domain), + '--xticlabels', + '--style', 'a', 'with points', + '--style', 'b', 'with lines', + '--xmin', '4.5', + '--xmax', '11.5', + '--ymin', '0', + '--ymax', '6'], + refplot => 'xticlabels-styles.ref' ); + +tryplot( testname => 'xticlabels styles with tuplesize', + cmd => qq{echo "$data_xticlabels"}, + options => [qw(--vnl --domain), + '--xticlabels', + '--tuplesizeall', '3', + '--with', 'linespoints pt variable', + '--xmin', '4.5', + '--xmax', '11.5', + '--ymin', '0', + '--ymax', '6'], + refplot => 'xticlabels-styles-with-tuplesize.ref' ); SKIP: { diff --git a/t/xticlabels-clustered.ref b/t/xticlabels-clustered.ref new file mode 100644 index 0000000..32abfc3 --- /dev/null +++ b/t/xticlabels-clustered.ref @@ -0,0 +1,39 @@ + 5 +-------------------------------------------------------------------------------------------+ + | + + * * + | + | * * | + | * * | + | * * | + | * * | + | * * | + 4 |-+ * ###### +-| + | * # # | + | * # # | + | * # # | + | * # # | + | * # # | + | * # # | + 3 |-+ ****** * # # +-| + | * * * # # | + | * * * # # | + | * * * # # | + | * * * # # | + | * * * # # | + | * * * # # | + | * * * # # | + 2 |-+ ***** * ##### * # # ****** +-| + | * * * # # * # # * * | + | * * * # # * # # * * | + | * * * # # * # # * * | + | * * * # # * # # * * | + | * * * # # * # # * * | + | * * * # # * # # * * | + 1 |-+ * ###### * # # * # # * ##### +-| + | * # # * # # * # # * # # | + | * # # * # # * # # * # # | + | * # # * # # * # # * # # | + | * # # * # # * # # * # # | + | * # # * # # * # # * # # | + | * # # * # # * # # * # # | + 0 +-------------------------------------------------------------------------------------------+ + aaa bbb ccc ddd + diff --git a/t/xticlabels-styles-with-tuplesize.ref b/t/xticlabels-styles-with-tuplesize.ref new file mode 100644 index 0000000..ea7b3eb --- /dev/null +++ b/t/xticlabels-styles-with-tuplesize.ref @@ -0,0 +1,39 @@ + 6 +-------------------------------------------------------------------------------------------+ + | + + + + | + | | + | | + | | + | | + 5 |-+ **D +-| + | **** * | + | **** * | + | ***** * | + | **** * | + | **** * | + 4 |-+ ***** * +-| + | **** * | + | **** * | + | ***** * | + | **** * | + | **** * | + 3 |-+ *B** * +-| + | ** * | + | ** * | + | ** * | + | ** * | + | ** * | + 2 |-+ A* A +-| + | | + | | + | | + | | + | | + 1 |-+ +-| + | | + | | + | | + | | + | + + + + | + 0 +-------------------------------------------------------------------------------------------+ + aaa bbb ccc ddd + diff --git a/t/xticlabels-styles.ref b/t/xticlabels-styles.ref new file mode 100644 index 0000000..50af2b5 --- /dev/null +++ b/t/xticlabels-styles.ref @@ -0,0 +1,39 @@ + 6 +-------------------------------------------------------------------------------------------+ + | + + + + | + | | + | | + | | + | | + 5 |-+ A +-| + | | + | | + | | + | | + | | + 4 |-+ ### +-| + | #### # | + | #### # | + | ##### # | + | #### # | + | #### # | + 3 |-+ A ##### # +-| + | #### # | + | #### # | + | ##### # | + | #### # | + | #### # | + 2 |-+ A #### # A +-| + | ## # | + | ## # | + | ## # | + | ## # | + | ## # | + 1 |-+ ## # +-| + | | + | | + | | + | | + | + + + + | + 0 +-------------------------------------------------------------------------------------------+ + aaa bbb ccc ddd +