From e5cff5b2233317cb7f8cb8465940c4e2f2aa1b9d Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 14 Feb 2016 18:56:19 +0200 Subject: [PATCH] tests/bytearray1: Add testcases for "in" operator. --- tests/basics/bytearray1.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/basics/bytearray1.py b/tests/basics/bytearray1.py index 2e47f17bf..b59850026 100644 --- a/tests/basics/bytearray1.py +++ b/tests/basics/bytearray1.py @@ -31,3 +31,9 @@ print(bytearray() == bytearray()) print(bytearray() == 1) # TODO: other comparisons + +# __contains__ +b = bytearray(b"\0foo\0") +print(b"foo" in b) +print(b"foo\x01" in b) +print(b"" in b)