1.1 --- a/tests/values.py Tue May 21 16:59:25 2024 +0200
1.2 +++ b/tests/values.py Tue May 21 17:02:10 2024 +0200
1.3 @@ -2,6 +2,28 @@
1.4 a = a - 1.0
1.5 return a
1.6
1.7 +def test_assign(l, x):
1.8 + l[0] = x
1.9 +
1.10 +def test_augmented(l, x):
1.11 + l[0] += x + l[1]
1.12 +
1.13 x = 2.0
1.14 print test(x) # 1.0
1.15 print x # 2.0
1.16 +
1.17 +l = [1, 2, 3]
1.18 +test_assign(l, 4)
1.19 +print l # [4, 2, 3]
1.20 +
1.21 +l2 = [1, 2, 3]
1.22 +test_augmented(l2, 1)
1.23 +print l2 # [4, 2, 3]
1.24 +
1.25 +l3 = [1.0, 2.0, 3.0]
1.26 +test_assign(l3, 4.0)
1.27 +print l3 # [4.0, 2.0, 3.0]
1.28 +
1.29 +l4 = [1.0, 2.0, 3.0]
1.30 +test_augmented(l4, 1.0)
1.31 +print l4 # [4.0, 2.0, 3.0]