mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-09-17 00:28:11 +08:00
Revert "Use value_counts instead of tally"
This commit is contained in:
17
test/youplot/backends/processing_test.rb
Normal file
17
test/youplot/backends/processing_test.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../../test_helper'
|
||||
|
||||
class YouPlotCommandTest < Test::Unit::TestCase
|
||||
test :count_values do
|
||||
@m = YouPlot::Backends::Processing
|
||||
assert_equal([%i[a b c], [3, 2, 1]], @m.count_values(%i[a a a b b c]))
|
||||
assert_equal([%i[c b a], [3, 2, 1]], @m.count_values(%i[a b b c c c]))
|
||||
end
|
||||
|
||||
test :count_values_non_tally do
|
||||
@m = YouPlot::Backends::Processing
|
||||
assert_equal([%i[a b c], [3, 2, 1]], @m.count_values(%i[a a a b b c], tally: false))
|
||||
assert_equal([%i[c b a], [3, 2, 1]], @m.count_values(%i[a b b c c c], tally: false))
|
||||
end
|
||||
end
|
@@ -112,15 +112,17 @@ class YouPlotSimpleTest < Test::Unit::TestCase
|
||||
assert_equal fixture('simple-boxplot.txt'), @stderr_file.read
|
||||
end
|
||||
|
||||
test :c do
|
||||
YouPlot::Command.new(['count']).run
|
||||
assert_equal fixture('simple-count.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 :count do
|
||||
YouPlot::Command.new(['c']).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 :plot_output_stdout do
|
||||
YouPlot::Command.new(['line', '-o']).run
|
||||
|
Reference in New Issue
Block a user