From 9011adb0de58f5fbc132a9c5f926e5177f70c71c Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Thu, 19 May 2022 13:53:33 +0100 Subject: [PATCH] tests: additional test addedwhich checks that merge and intersction of idls agree for identical idls. --- tests/obs_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/obs_test.py b/tests/obs_test.py index 6dd460c9..82b5ffec 100644 --- a/tests/obs_test.py +++ b/tests/obs_test.py @@ -524,6 +524,12 @@ def test_intersection_idx(): for ids in [[list(range(1, 80, 3)), list(range(1, 100, 2))], [range(1, 80, 3), range(1, 100, 2), range(1, 100, 7)]]: assert list(pe.obs._intersection_idx(ids)) == pe.obs._intersection_idx([list(o) for o in ids]) +def test_merge_intersection(): + for idl_list in [[range(1, 100), range(1, 100), range(1, 100)], + [range(4, 80, 6), range(4, 80, 6)], + [[0, 2, 8, 19, 205], [0, 2, 8, 19, 205]]]: + assert pe.obs._merge_idx(idl_list) == pe.obs._intersection_idx(idl_list) + def test_intersection_collapse(): range1 = range(1, 2000, 2)