mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-09-17 00:28:11 +08:00
Improved simple test
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user