aboutsummaryrefslogtreecommitdiff
path: root/tests/basics
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics')
-rw-r--r--tests/basics/tests/set_symmetric_difference.py7
-rw-r--r--tests/basics/tests/set_union.py1
-rw-r--r--tests/basics/tests/set_update.py12
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/basics/tests/set_symmetric_difference.py b/tests/basics/tests/set_symmetric_difference.py
new file mode 100644
index 000000000..acf298385
--- /dev/null
+++ b/tests/basics/tests/set_symmetric_difference.py
@@ -0,0 +1,7 @@
+print({1,2}.symmetric_difference({2,3}))
+print({1,2}.symmetric_difference([2,3]))
+s = {1,2}
+print(s.symmetric_difference_update({2,3}))
+l = list(s)
+l.sort()
+print(l)
diff --git a/tests/basics/tests/set_union.py b/tests/basics/tests/set_union.py
new file mode 100644
index 000000000..2adcc972c
--- /dev/null
+++ b/tests/basics/tests/set_union.py
@@ -0,0 +1 @@
+print({1}.union({2}))
diff --git a/tests/basics/tests/set_update.py b/tests/basics/tests/set_update.py
new file mode 100644
index 000000000..78cd76356
--- /dev/null
+++ b/tests/basics/tests/set_update.py
@@ -0,0 +1,12 @@
+def report(s):
+ l = list(s)
+ l.sort()
+ print(l)
+
+s = {1}
+s.update()
+report(s)
+s.update([2])
+report(s)
+s.update([1,3], [2,2,4])
+report(s)