diff --git a/src/validate.lua b/src/validate.lua index e5547e8..c868700 100644 --- a/src/validate.lua +++ b/src/validate.lua @@ -127,6 +127,10 @@ M.assert_valid_pattern = function(what, pat) end end +M.validate_plot_ticks_y = function(what, x) + M.assert_greater_than(what..'.plot.ticks_y', x, 2) +end + -- TODO make spacing parameters aware of thickness, right now they start at the -- centry of lines, circles, etc. @@ -138,15 +142,15 @@ end local validate_graphics = function(x) M.assert_file_readable('graphics.dev_power', x.dev_power) - M.assert_greater_than('graphics.genometry.plot.ticks_y', x.geometry.plot.ticks_y, 2) + M.validate_plot_ticks_y('graphics.geometry', x.geometry.plot.ticks_y) end local validate_memory = function(x) - M.assert_greater_than('memory.genometry.plot.ticks_y', x.geometry.plot.ticks_y, 2) + M.validate_plot_ticks_y('memory.geometry', x.geometry.plot.ticks_y) end local validate_network = function(x) - M.assert_greater_than('network.genometry.plot.ticks_y', x.geometry.plot.ticks_y, 2) + M.validate_plot_ticks_y('network.geometry', x.geometry.plot.ticks_y) end local validate_pacman = function(_) @@ -171,7 +175,7 @@ local validate_processor = function(x) end local validate_readwrite = function(x) - M.assert_greater_than('readwrite.genometry.plot.ticks_y', x.geometry.plot.ticks_y, 2) + M.validate_plot_ticks_y('readwrite.geometry', x.geometry.plot.ticks_y) end local validate_system = function(_)