Skip to content

Commit a0ccbee

Browse files
committed
Added unit tests
1 parent 033b5bb commit a0ccbee

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_list.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018, 2019, Oracle and/or its affiliates.
1+
# Copyright (c) 2018, 2020, Oracle and/or its affiliates.
22
# Copyright (C) 1996-2017 Python Software Foundation
33
#
44
# Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -91,6 +91,10 @@ def imul(a, b): a *= b
9191
self.assertRaises((MemoryError, OverflowError), mul, lst, n)
9292
self.assertRaises((MemoryError, OverflowError), imul, lst, n)
9393

94+
def test_large_index(self):
95+
lst = [0]
96+
self.assertRaises(IndexError, lambda: lst[2**100])
97+
9498
def test_repr_large(self):
9599

96100
# Check the repr of large list objects

graalpython/com.oracle.graal.python.test/src/tests/test_string.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def test_find():
5454
assert s.find('cau', MyIndexable(5), None) == 5
5555
assert s.find('cau', MyIndexable(5), MyIndexable(8)) == 5
5656
assert s.find('cau', None, MyIndexable(8)) == 5
57+
assert s.find('cau', 2**100) == -1
5758

5859

5960
def test_rfind():

0 commit comments

Comments
 (0)