text: import numpy as np
  
  def test(test_cases, target):
      success = 0
      for test_case in test_cases:
          try:
              if test_case['name'] == "datatype_check":
                  assert isinstance(target(*test_case['input']),
                                    test_case["expected"])
                  success += 1
              if test_case['name'] == "equation_output_check":
                  assert np.allclose(test_case["expected"],
                                     target(*test_case['input']))
                  success += 1
              if test_case['name'] == "shape_check":
                  assert test_case['expected'].shape == target(*test_case['input']).shape
                  success += 1
          except:
              print("Error: " + test_case['error'])
              
      if success == len(test_cases):
          print("\033[92m All tests passed.")
      else:
          print('\033[92m', success," Tests passed")
          print('\033[91m', len(test_cases) - success, " Tests failed")
          raise AssertionError("Not all tests were passed for {}. Check your equations and avoid using global variables inside the function.".format(target.__name__))