From 98ba70cd3ead57b1eaf3f3bee4ad1430393eab77 Mon Sep 17 00:00:00 2001 From: Kautik Khokhar Date: Fri, 13 Dec 2024 05:49:16 +0000 Subject: [PATCH] Modifies shim gsutil rsync test to escape pipe character using `^^^` string in windows machines. --- gslib/tests/test_rsync.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gslib/tests/test_rsync.py b/gslib/tests/test_rsync.py index ae56f3784..01e857ede 100644 --- a/gslib/tests/test_rsync.py +++ b/gslib/tests/test_rsync.py @@ -2999,7 +2999,13 @@ def _Check1(): def _Check2(): """Tests that a regex with a pipe works as expected.""" - _check_exclude_regex('^data|[bc]$', set(['/a'])) + if self._use_gcloud_storage and IS_WINDOWS: + # Pipe character should be escaped for windows cmd. + # It appears that ^ is not escaping | as expected but ^^^ does So + # changing input for windows shim mode gsutil test. + _check_exclude_regex('^data^^^|[bc]$', set(['/a'])) + else: + _check_exclude_regex('^data|[bc]$', set(['/a'])) _Check2()