8000 Add test to disallow negatives. · python/cpython@4d62380 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4d62380

Browse files
committed
Add test to disallow negatives.
1 parent 60ea4d6 commit 4d62380

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Lib/test/test_readline.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ def test_write_read_append(self):
113113
# write_history_file can create the target
114114
readline.write_history_file(hfilename)
115115

116+
# Negative values should be disallowed
117+
with self.assertRaises(ValueError):
118+
readline.append_history_file(-42, hfilename)
119+
120+
# See gh-122431, using the minumum signed integer value caused a segfault
121+
with self.assertRaises(ValueError):
122+
readline.append_history_file(-2147483648, hfilename)
123+
116124
def test_nonascii_history(self):
117125
readline.clear_history()
118126
try:

0 commit comments

Comments
 (0)
0