From 6d499dea53c76de714a70488a776ddd8daf91500 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 11 Jan 2021 10:29:59 -0500 Subject: [PATCH] exclude nul from the tested argv values --- src/allmydata/test/test_windows.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/allmydata/test/test_windows.py b/src/allmydata/test/test_windows.py index 1d5c2632d..6e46a7e8f 100644 --- a/src/allmydata/test/test_windows.py +++ b/src/allmydata/test/test_windows.py @@ -57,6 +57,7 @@ from hypothesis import ( from hypothesis.strategies import ( lists, text, + characters, ) from .common import ( @@ -93,7 +94,23 @@ class GetArgvTests(SyncTestCase): suppress_health_check=[HealthCheck.too_slow], deadline=None, ) - @given(lists(text(min_size=1, max_size=4), min_size=1, max_size=4)) + @given( + lists( + text( + alphabet=characters( + blacklist_categories=('Cs',), + # Windows CommandLine is a null-terminated string, + # analogous to POSIX exec* arguments. So exclude nul from + # our generated arguments. + blacklist_characters=('\x00',), + ), + min_size=1, + max_size=4, + ), + min_size=1, + max_size=4, + ), + ) def test_argv_values(self, argv): """ ``get_argv`` returns a list representing the result of tokenizing the