aboutsummaryrefslogtreecommitdiff
path: root/tests/basics
diff options
context:
space:
mode:
authorJohn R. Lenton2014-01-12 19:39:48 +0000
committerJohn R. Lenton2014-01-12 19:50:50 +0000
commit0de386bffec8acddcbe8c15913396035ea0b6405 (patch)
tree76ba09e003a8cabfd62c145e73db957557bfa3e0 /tests/basics
parentae00d334c6222fa9716135967a7c512b03f08191 (diff)
Implemented set.update
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)