From be066a57ebd41d2a6290d7de3af81937a96e843d Mon Sep 17 00:00:00 2001 From: Andrey Kruchinkin Date: Sat, 5 Sep 2026 02:43:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BE=D0=B1=D1=89=D0=B8=D0=B9=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BD=D1=82=D1=80=D0=B0=D0=BA=D1=82=20=D0=B3=D1=80=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=86=20=D0=BE=D1=81=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c/set-protocol/tests/fixtures/plot-v1.json | 4 +++- python/tests/test_plot.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/c/set-protocol/tests/fixtures/plot-v1.json b/c/set-protocol/tests/fixtures/plot-v1.json index 1e8715d..b5b9a34 100644 --- a/c/set-protocol/tests/fixtures/plot-v1.json +++ b/c/set-protocol/tests/fixtures/plot-v1.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "cases": [ {"name":"zoom_x_anchor","op":0,"input":[0,0,1,1,2,1,0,0,0.25,0.5],"output":[0.125,0,0.5,1]}, {"name":"zoom_y_anchor","op":0,"input":[0,0,1,1,1,4,0,0,0.5,0.75],"output":[0,0.5625,1,0.25]}, @@ -23,6 +23,8 @@ {"name":"db_gain","op":7,"input":[1,10],"output":[20]}, {"name":"db_attenuation","op":7,"input":[10,1],"output":[-20]}, {"name":"db_zero_reference","op":7,"input":[0,1],"output":null}, + {"name":"absolute_limits","op":8,"input":[0,500,-2,2],"output":[0,500,-2,2]}, + {"name":"reversed_x_limits","op":8,"input":[1,1,-2,2],"output":null}, {"name":"zero_range","op":2,"input":[1,1,1,0],"output":null}, {"name":"zero_pixels","op":4,"input":[0,1,0,0,1,0],"output":null}, {"name":"bad_viewport","op":0,"input":[0,0,0,1,2,1,0,0,0.5,0.5],"output":null} diff --git a/python/tests/test_plot.py b/python/tests/test_plot.py index a2ba188..ba3281f 100644 --- a/python/tests/test_plot.py +++ b/python/tests/test_plot.py @@ -56,6 +56,9 @@ class PlotTests(unittest.TestCase): self.assertAlmostEqual(20, self.core.db_delta(1, 10)) self.assertAlmostEqual(-20, self.core.db_delta(10, 1)) self.assertIsNone(self.core.db_delta(0, 1)) + self.assertEqual(Bounds(0, 500, -2, 2), self.core.limits(0, 500, -2, 2)) + with self.assertRaises(ValueError): + self.core.limits(1, 1, -2, 2) if __name__ == "__main__":