diff --git a/test/fixtures/simple-histogram-symbol-@.txt b/test/fixtures/simple-histogram-symbol-@.txt new file mode 100644 index 0000000..e83f7c3 --- /dev/null +++ b/test/fixtures/simple-histogram-symbol-@.txt @@ -0,0 +1,9 @@ + ┌ ┐ + [-60.0, -40.0) ┤@@@@@@@@@@@@@@@@@@@ 1 + [-40.0, -20.0) ┤@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2 + [-20.0, 0.0) ┤@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2 + [ 0.0, 20.0) ┤@@@@@@@@@@@@@@@@@@@ 1 + [ 20.0, 40.0) ┤@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2 + [ 40.0, 60.0) ┤@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2 + └ ┘ + Frequency diff --git a/test/fixtures/simple-lineplot-canvas-ascii.txt b/test/fixtures/simple-lineplot-canvas-ascii.txt new file mode 100644 index 0000000..f96fe46 --- /dev/null +++ b/test/fixtures/simple-lineplot-canvas-ascii.txt @@ -0,0 +1,18 @@ + ┌────────────────────────────────────────┐ + 50 │ |│ + │ ., /│ + │ .\ /│ + │ .\ |\ .`│ + │ , /\ ,`", . │ + │ /|. .` . / \ | │ + │ .\. .` \ / l / \ | │ + │-----^r----^---r--------r--------r---|--│ + │.` \. | \ / | | \ | │ + │` \./ . .` |. | \ | │ + │ \` |./ . . ", ,` │ + │ \` \ | \ / │ + │ " |` \ | │ + │ / ",` │ + -50 │ Y │ + └────────────────────────────────────────┘ + 1 10 diff --git a/test/fixtures/simple-lineplot-canvas-density.txt b/test/fixtures/simple-lineplot-canvas-density.txt new file mode 100644 index 0000000..8227c78 --- /dev/null +++ b/test/fixtures/simple-lineplot-canvas-density.txt @@ -0,0 +1,18 @@ + ┌────────────────────────────────────────┐ + 50 │ ░│ + │ ░ ░│ + │ ░░ ░│ + │ ░▒ ░░ ░░│ + │ ░ ░░ ░░░ ░ │ + │ ░░ ░░ ░ ░ ░ ░ │ + │ ░▒ ░░ ░ ░ ░ ░ ░ ░ │ + │░░▒░░▒░░░░░▒░░░░░░░░▒░░░░░░░░░░░░░░░░▒░░│ + │░░ ░ ░ ░ ░ ░ ░ ░ ░ │ + │░ ░ ░░ ░░ ░ ░ ░ ░ ░ │ + │ ▒░ ░ ░ ░ ░ ░░ ░░ │ + │ ░░ ░ ░ ░ ░ │ + │ ░ ░░ ░ ░ │ + │ ▓ ░░░ │ + -50 │ █ │ + └────────────────────────────────────────┘ + 1 10 diff --git a/test/fixtures/simple-lineplot-canvas-dot.txt b/test/fixtures/simple-lineplot-canvas-dot.txt new file mode 100644 index 0000000..5e4cebd --- /dev/null +++ b/test/fixtures/simple-lineplot-canvas-dot.txt @@ -0,0 +1,18 @@ + ┌────────────────────────────────────────┐ + 50 │ :│ + │ . :│ + │ :: :│ + │ .: :: .'│ + │ . :: :'. : │ + │ :: .' : : : : │ + │ .: .' : : : : : : │ + │..:..:.....:..:.....:..:.....:..:....:..│ + │.' : : : : : : : : │ + │' : .' '. : : : : : │ + │ :' : : : : '. .' │ + │ :: : : : : │ + │ ' :: : : │ + │ : '.' │ + -50 │ : │ + └────────────────────────────────────────┘ + 1 10 diff --git a/test/youplot/simple_test.rb b/test/youplot/simple_test.rb index d2d719d..9f81eb7 100644 --- a/test/youplot/simple_test.rb +++ b/test/youplot/simple_test.rb @@ -212,4 +212,34 @@ class YouPlotSimpleTest < Test::Unit::TestCase YouPlot::Command.new(['line', '--border', 'barplot']).run assert_equal fixture('simple-lineplot-border-barplot.txt'), @stderr_file.read end + + test :line_canvas_ascii do + YouPlot::Command.new(['line', '--canvas', 'ascii']).run + assert_equal fixture('simple-lineplot-canvas-ascii.txt'), @stderr_file.read + end + + test :line_canvas_braille do + YouPlot::Command.new(['line', '--canvas', 'braille']).run + assert_equal fixture('simple-lineplot.txt'), @stderr_file.read + end + + test :line_canvas_density do + YouPlot::Command.new(['line', '--canvas', 'density']).run + assert_equal fixture('simple-lineplot-canvas-density.txt'), @stderr_file.read + end + + test :line_canvas_dot do + YouPlot::Command.new(['line', '--canvas', 'dot']).run + assert_equal fixture('simple-lineplot-canvas-dot.txt'), @stderr_file.read + end + + # test :line_canvas_block do + # YouPlot::Command.new(['line', '--canvas', 'block']).run + # assert_equal fixture('simple-lineplot-canvas-dot.txt'), @stderr_file.read + # end + + test :hist_symbol_atmark do + YouPlot::Command.new(['hist', '--symbol', '@']).run + assert_equal fixture('simple-histogram-symbol-@.txt'), @stderr_file.read + end end