Skip to content

Commit

Permalink
test_unit_parse_encrypt: skip double star test when running on mac
Browse files Browse the repository at this point in the history
Since the included bash version on mac doesn't support double star.
  • Loading branch information
erijo committed Nov 24, 2024
1 parent 5b44afa commit 6111744
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions test/test_unit_parse_encrypt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Unit tests: parse_encrypt"""

import sys

import pytest


Expand Down Expand Up @@ -123,16 +125,17 @@ def create_test_encrypt_data(paths):
expected.add("ex ex/file4")
expected.add("ex ex/file6.text")

# double star
edata += "doublestar/**/file*\n"
edata += "!**/file3\n"
paths.work.join("doublestar/a/b/file1").write("", ensure=True)
paths.work.join("doublestar/c/d/file2").write("", ensure=True)
paths.work.join("doublestar/e/f/file3").write("", ensure=True)
paths.work.join("doublestar/g/h/nomatch").write("", ensure=True)
expected.add("doublestar/a/b/file1")
expected.add("doublestar/c/d/file2")
# doublestar/e/f/file3 is excluded
# double star (not supported on bash 3 which is the default on macOS)
if sys.platform != "darwin":
edata += "doublestar/**/file*\n"
edata += "!**/file3\n"
paths.work.join("doublestar/a/b/file1").write("", ensure=True)
paths.work.join("doublestar/c/d/file2").write("", ensure=True)
paths.work.join("doublestar/e/f/file3").write("", ensure=True)
paths.work.join("doublestar/g/h/nomatch").write("", ensure=True)
expected.add("doublestar/a/b/file1")
expected.add("doublestar/c/d/file2")
# doublestar/e/f/file3 is excluded

return edata, expected

Expand Down

0 comments on commit 6111744

Please sign in to comment.