diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basics/tests/is-isnot.py | 14 | ||||
-rw-r--r-- | tests/basics/tests/sorted.py | 2 | ||||
-rw-r--r-- | tests/basics/tests/zip.py | 2 |
3 files changed, 18 insertions, 0 deletions
diff --git a/tests/basics/tests/is-isnot.py b/tests/basics/tests/is-isnot.py new file mode 100644 index 0000000000..990190aa41 --- /dev/null +++ b/tests/basics/tests/is-isnot.py @@ -0,0 +1,14 @@ +print(1 is 1) +print(1 is 2) +print(1 is not 1) +print(1 is not 2) + + +print([1, 2] is [1, 2]) +a = [1, 2] +b = a +print(b is a) + +# TODO: strings require special "is" handling, postponed +# until qstr refactor. +#print("a" is "a") diff --git a/tests/basics/tests/sorted.py b/tests/basics/tests/sorted.py new file mode 100644 index 0000000000..bbec319460 --- /dev/null +++ b/tests/basics/tests/sorted.py @@ -0,0 +1,2 @@ +print(sorted(set(range(100)))) +print(sorted(set(range(100)), key=lambda x: x + 100*(x % 2))) diff --git a/tests/basics/tests/zip.py b/tests/basics/tests/zip.py new file mode 100644 index 0000000000..c0109094f4 --- /dev/null +++ b/tests/basics/tests/zip.py @@ -0,0 +1,2 @@ +print(list(zip())) +print(list(zip([1], {2,3}))) |