#!/usr/bin/env python3 """Test file for array_intersection.py""" import sys sys.path.insert(0, '/root/.hermes/wizard-outputs/spark') from array_intersection import array_intersection # Test cases tests = [ ([1, 2, 3, 4, 5], [3, 4, 5, 6, 7], [3, 4, 5]), ([1, 1, 2, 2], [2, 2, 3, 3], [2]), ([], [1, 2, 3], []), ([1, 2, 3], [], []), (['a', 'b'], ['b', 'c'], ['b']), ] all_passed = True for arr1, arr2, expected in tests: result = array_intersection(arr1, arr2) if result != expected: print(f'FAIL: {arr1} ∩ {arr2} = {result}, expected {expected}') all_passed = False else: print(f'PASS: {arr1} ∩ {arr2} = {result}') if all_passed: print('All tests passed!') sys.exit(0) else: print('Some tests failed!') sys.exit(1)