extracted augment assignment tests

This commit is contained in:
Ekaterina Tuzova
2013-10-10 17:45:17 +04:00
parent dd75fa1844
commit ddb0d98b13
21 changed files with 91 additions and 40 deletions

View File

@@ -0,0 +1,2 @@
exp = 2
<weak_warning descr="Assignment can be replaced with augmented assignment">value = value <caret>/ (10**exp) #comment</weak_warning>

View File

@@ -0,0 +1,2 @@
exp = 2
value /= 10 ** exp#comment

View File

@@ -0,0 +1,5 @@
def retStr():
return ''
s1 = ''
<weak_warning descr="Assignment can be replaced with augmented assignment">s1 = s1 <caret>+ retStr()</weak_warning>

View File

@@ -0,0 +1,5 @@
def retStr():
return ''
s1 = ''
s1 += retStr()

View File

@@ -0,0 +1 @@
<weak_warning descr="Assignment can be replaced with augmented assignment">request = request + " FROM bugs WHERE bug_id = %s" % (str(bug_id))</weak_warning>

View File

@@ -0,0 +1 @@
request += " FROM bugs WHERE bug_id = %s" % (str(bug_id))

View File

@@ -0,0 +1,3 @@
v = 0
f = 1
<weak_warning descr="Assignment can be replaced with augmented assignment">v = <caret>f + v</weak_warning>

View File

@@ -0,0 +1,3 @@
v = 0
f = 1
v += f

View File

@@ -0,0 +1 @@
<weak_warning descr="Assignment can be replaced with augmented assignment">var = <caret>var + 3</weak_warning>

View File

@@ -0,0 +1 @@
var += 3

View File

@@ -0,0 +1,3 @@
current_sum = 1
numbers = [1, 2, 3]
<weak_warning descr="Assignment can be replaced with augmented assignment">current_sum = current_sum + numbers[0]</weak_warning>

View File

@@ -0,0 +1,3 @@
current_sum = 1
numbers = [1, 2, 3]
current_sum += numbers[0]

View File

@@ -0,0 +1,4 @@
class A:
x = 3
a = A()
<weak_warning descr="Assignment can be replaced with augmented assignment">a.x = a.x +<caret> 1</weak_warning>

View File

@@ -0,0 +1,4 @@
class A:
x = 3
a = A()
a.x += 1