diff options
| author | stijn <stijn@ignitron.net> | 2021-05-10 16:40:51 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-05-13 22:16:14 +1000 |
| commit | 09be0c083cb493c70b38079aa6fd785aa9b0b90a (patch) | |
| tree | 531a4e6ab1d211be846186bae4a804f2b9719b97 /tests/basics/bytearray1.py | |
| parent | 57365d855734142deb030ebcd00c10efcedf554b (diff) | |
py/objarray: Implement more/less comparisons for array.
Diffstat (limited to 'tests/basics/bytearray1.py')
| -rw-r--r-- | tests/basics/bytearray1.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/basics/bytearray1.py b/tests/basics/bytearray1.py index b59850026..d12292e87 100644 --- a/tests/basics/bytearray1.py +++ b/tests/basics/bytearray1.py @@ -27,6 +27,26 @@ print(bytearray([1]) == b"1") print(b"1" == bytearray([1])) print(bytearray() == bytearray()) +b1 = bytearray([1, 2, 3]) +b2 = bytearray([1, 2, 3]) +b3 = bytearray([1, 3]) +print(b1 == b2) +print(b2 != b3) +print(b1 <= b2) +print(b1 <= b3) +print(b1 < b3) +print(b1 >= b2) +print(b3 >= b2) +print(b3 > b2) +print(b1 != b2) +print(b2 == b3) +print(b1 > b2) +print(b1 > b3) +print(b1 >= b3) +print(b1 < b2) +print(b3 < b2) +print(b3 <= b2) + # comparison with other type should return False print(bytearray() == 1) |
