From 5c80d06c5903129532b8315352b01f730ec48c3d Mon Sep 17 00:00:00 2001 From: Charles T Date: Tue, 17 May 2022 08:23:03 +0200 Subject: [PATCH] test(costl2): add cost on segment of length 1 --- tests/test_costs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_costs.py b/tests/test_costs.py index 2920fcb1..fcc6ac82 100644 --- a/tests/test_costs.py +++ b/tests/test_costs.py @@ -103,6 +103,9 @@ def test_costs_5D_names(signal_bkps_5D, cost_name): cost.error(100, signal.shape[0]) cost.error(10, 50) cost.sum_of_costs(bkps) + if cost_name == "l2": + assert cost.error(1, 2)==0., "CostL2 on segment of size 1 returns 0." + with pytest.raises(NotEnoughPoints): if cost_name == "cosine": cost.min_size = 4