From 715ec8f908a25305bd45c490fb13b596a85a809a Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Thu, 27 May 2021 23:49:03 +0900 Subject: [PATCH] Add a test for count Check that it works. This is not enough --- test/fixtures/simple-count.txt | 12 ++++++++++++ test/youplot/simple_test.rb | 18 ++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 test/fixtures/simple-count.txt diff --git a/test/fixtures/simple-count.txt b/test/fixtures/simple-count.txt new file mode 100644 index 0000000..222f49c --- /dev/null +++ b/test/fixtures/simple-count.txt @@ -0,0 +1,12 @@ + ┌ ┐ + -10 ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 1.0 + 10 ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 1.0 + -20 ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 1.0 + 20 ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 1.0 + -30 ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 1.0 + 30 ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 1.0 + -40 ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 1.0 + 40 ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 1.0 + -50 ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 1.0 + 50 ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 1.0 + └ ┘ diff --git a/test/youplot/simple_test.rb b/test/youplot/simple_test.rb index 44fc3b1..eaf1ca2 100644 --- a/test/youplot/simple_test.rb +++ b/test/youplot/simple_test.rb @@ -112,17 +112,15 @@ class YouPlotSimpleTest < Test::Unit::TestCase assert_equal fixture('simple-boxplot.txt'), @stderr_file.read end - # test :c do - # omit - # YouPlot::Command.new(['count', '-H', '-d,']).run - # assert_equal fixture('iris-count.txt'), @stderr_file.read - # end + test :c do + YouPlot::Command.new(['count']).run + assert_equal fixture('simple-count.txt'), @stderr_file.read + end - # test :count do - # omit - # YouPlot::Command.new(['c', '-H', '-d,']).run - # assert_equal fixture('iris-count.txt'), @stderr_file.read - # end + test :count do + YouPlot::Command.new(['c']).run + assert_equal fixture('simple-count.txt'), @stderr_file.read + end test :plot_output_stdout do YouPlot::Command.new(['line', '-o']).run