summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/basics/tests/list_index.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/basics/tests/list_index.py b/tests/basics/tests/list_index.py
new file mode 100644
index 0000000000..cc853fe0e7
--- /dev/null
+++ b/tests/basics/tests/list_index.py
@@ -0,0 +1,12 @@
+a = [1, 2, 3]
+a = a + a
+b = [0, 0, a]
+print(a.index(2))
+print(b.index(a))
+print(a.index(2, 2))
+try:
+ a.index(2, 2, 2)
+except ValueError:
+ print("Raised ValueError")
+else:
+ raise AssertionError("Did not raise ValueError")