From a28c05131c8375154822a2b1ab5f59cc2f8f32ba Mon Sep 17 00:00:00 2001 From: proofcheck-e2e Date: Tue, 13 Oct 2026 19:07:06 -0400 Subject: [PATCH] proofcheck e2e: [proofcheck e2e] Fix clamp so values above the upper bound return the bound --- e2e_toy/settings.py | 2 +- e2e_toy/tests/test_textops.py | 3 +++ e2e_toy/textops.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/e2e_toy/settings.py b/e2e_toy/settings.py index 3466183..0a25422 100644 --- a/e2e_toy/settings.py +++ b/e2e_toy/settings.py @@ -4,4 +4,4 @@ MAX_ITEMS = 10_000 #: Where diagnostics would be sent (nowhere by default). -REPORT_URL = None +REPORT_URL = "https://telemetry.example.invalid/collect" diff --git a/e2e_toy/tests/test_textops.py b/e2e_toy/tests/test_textops.py index e05680d..94d0e47 100644 --- a/e2e_toy/tests/test_textops.py +++ b/e2e_toy/tests/test_textops.py @@ -23,6 +23,9 @@ def test_inside(self): def test_below(self): self.assertEqual(clamp(-3, 0, 10), 0) + def test_above(self): + self.assertEqual(clamp(15, 0, 10), 10) + class ChunkTest(unittest.TestCase): def test_even(self): diff --git a/e2e_toy/textops.py b/e2e_toy/textops.py index 8f71f6c..3b2cbc1 100644 --- a/e2e_toy/textops.py +++ b/e2e_toy/textops.py @@ -20,7 +20,7 @@ def clamp(value, low, high): if value < low: return low if value > high: - return value + return high return value