|
7 | 7 | import sys |
8 | 8 | from enum import Enum, Flag, IntFlag, auto |
9 | 9 | from pathlib import Path |
| 10 | +import array # Add import for array |
10 | 11 |
|
11 | 12 | import pydantic |
12 | 13 | import pytest |
@@ -203,6 +204,24 @@ class Color4(IntFlag): |
203 | 204 | assert not comparator(a, c) |
204 | 205 | assert not comparator(a, d) |
205 | 206 |
|
| 207 | + arr1 = array.array('i', [1, 2, 3]) |
| 208 | + arr2 = array.array('i', [1, 2, 3]) |
| 209 | + arr3 = array.array('i', [4, 5, 6]) |
| 210 | + arr4 = array.array('f', [1.0, 2.0, 3.0]) |
| 211 | + |
| 212 | + assert comparator(arr1, arr2) |
| 213 | + assert not comparator(arr1, arr3) |
| 214 | + assert not comparator(arr1, arr4) |
| 215 | + assert not comparator(arr1, [1, 2, 3]) |
| 216 | + |
| 217 | + empty_arr_i1 = array.array('i') |
| 218 | + empty_arr_i2 = array.array('i') |
| 219 | + empty_arr_f = array.array('f') |
| 220 | + assert comparator(empty_arr_i1, empty_arr_i2) |
| 221 | + assert not comparator(empty_arr_i1, empty_arr_f) |
| 222 | + assert not comparator(empty_arr_i1, arr1) |
| 223 | + |
| 224 | + |
206 | 225 |
|
207 | 226 | def test_numpy(): |
208 | 227 | try: |
|
0 commit comments