MCPcopy
hub / github.com/keon/algorithms / test_remove_duplicates

Method test_remove_duplicates

tests/test_array.py:294–315  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

292
293class TestRemoveDuplicate(unittest.TestCase):
294 def test_remove_duplicates(self):
295 self.assertListEqual(
296 remove_duplicates(
297 [1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 6, 7, 7, 7, 8, 8, 9, 10, 10]
298 ),
299 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
300 )
301 self.assertListEqual(
302 remove_duplicates(["hey", "hello", "hello", "car", "house", "house"]),
303 ["hey", "hello", "car", "house"],
304 )
305 self.assertListEqual(
306 remove_duplicates([True, True, False, True, False, None, None]),
307 [True, False, None],
308 )
309 self.assertListEqual(
310 remove_duplicates([1, 1, "hello", "hello", True, False, False]),
311 [1, "hello", False],
312 )
313 self.assertListEqual(
314 remove_duplicates([1, "hello", True, False]), [1, "hello", False]
315 )
316
317
318class TestRotateArray(unittest.TestCase):

Callers

nothing calls this directly

Calls 1

remove_duplicatesFunction · 0.90

Tested by

no test coverage detected