summaryrefslogtreecommitdiff
path: root/tests/functional/d
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/d')
-rw-r--r--tests/functional/d/dangerous_default_value_py30.py30
-rw-r--r--tests/functional/d/dangerous_default_value_py30.txt9
2 files changed, 37 insertions, 2 deletions
diff --git a/tests/functional/d/dangerous_default_value_py30.py b/tests/functional/d/dangerous_default_value_py30.py
index 58a22f443..9aab81635 100644
--- a/tests/functional/d/dangerous_default_value_py30.py
+++ b/tests/functional/d/dangerous_default_value_py30.py
@@ -1,5 +1,5 @@
# pylint: disable=missing-docstring
-
+import collections
HEHE = {}
@@ -77,3 +77,31 @@ def function15(value=INVALID_DICT): # [dangerous-default-value]
def function16(value={1}): # [dangerous-default-value]
"""set literal as default value"""
return value
+
+def function17(value=collections.deque()): # [dangerous-default-value]
+ """mutable, dangerous"""
+ return value
+
+def function18(value=collections.ChainMap()): # [dangerous-default-value]
+ """mutable, dangerous"""
+ return value
+
+def function19(value=collections.Counter()): # [dangerous-default-value]
+ """mutable, dangerous"""
+ return value
+
+def function20(value=collections.OrderedDict()): # [dangerous-default-value]
+ """mutable, dangerous"""
+ return value
+
+def function21(value=collections.defaultdict()): # [dangerous-default-value]
+ """mutable, dangerous"""
+ return value
+
+def function22(value=collections.UserDict()): # [dangerous-default-value]
+ """mutable, dangerous"""
+ return value
+
+def function23(value=collections.UserList()): # [dangerous-default-value]
+ """mutable, dangerous"""
+ return value
diff --git a/tests/functional/d/dangerous_default_value_py30.txt b/tests/functional/d/dangerous_default_value_py30.txt
index 7571c00f7..40caaf5a3 100644
--- a/tests/functional/d/dangerous_default_value_py30.txt
+++ b/tests/functional/d/dangerous_default_value_py30.txt
@@ -11,4 +11,11 @@ dangerous-default-value:52:function12:Dangerous default value dict() (builtins.d
dangerous-default-value:61:function13:Dangerous default value OINK (builtins.dict) as argument
dangerous-default-value:65:function14:Dangerous default value dict() (builtins.dict) as argument
dangerous-default-value:73:function15:Dangerous default value INVALID_DICT (builtins.dict) as argument
-dangerous-default-value:77:function16:Dangerous default value set() as argument \ No newline at end of file
+dangerous-default-value:77:function16:Dangerous default value set() as argument
+dangerous-default-value:81:function17:Dangerous default value deque() (collections.deque) as argument
+dangerous-default-value:85:function18:Dangerous default value ChainMap() (collections.ChainMap) as argument
+dangerous-default-value:89:function19:Dangerous default value Counter() (collections.Counter) as argument
+dangerous-default-value:93:function20:Dangerous default value OrderedDict() (collections.OrderedDict) as argument
+dangerous-default-value:97:function21:Dangerous default value defaultdict() (collections.defaultdict) as argument
+dangerous-default-value:101:function22:Dangerous default value UserDict() (collections.UserDict) as argument
+dangerous-default-value:105:function23:Dangerous default value UserList() (collections.UserList) as argument