Improved simple test

This commit is contained in:
kojix2
2021-01-20 22:21:37 +09:00
parent 3bbcea165f
commit 2e4666f9b4
6 changed files with 116 additions and 96 deletions

View File

@@ -7,6 +7,8 @@ module YouPlot
# plotting functions.
module Backends
module UnicodePlotBackend
class Error < StandardError; end
module_function
def barplot(data, params, fmt = nil, count: false)
@@ -193,14 +195,14 @@ module YouPlot
warn " Headers: \e[35m#{data.headers.inspect}\e[0m"
warn " The first item is: \e[35m\"#{series[0][0]}\"\e[0m"
warn " The last item is : \e[35m\"#{series[0][-1]}\"\e[0m"
exit 1 if YouPlot.run_as_executable?
YouPlot.run_as_executable ? exit(1) : raise(Error)
end
if fmt == 'xyxy' && series.size.odd?
warn 'YouPlot: In the xyxy format, the number of series must be even.'
warn ''
warn " Number of series: \e[35m#{series.size}\e[0m"
warn " Headers: \e[35m#{data.headers.inspect}\e[0m"
exit 1 if YouPlot.run_as_executable?
YouPlot.run_as_executable ? exit(1) : raise(Error)
end
end
end