Patchwork D3472: tests: port test-minifileset.py to Python 3

login
register
mail settings
Submitter phabricator
Date May 8, 2018, 1:34 p.m.
Message ID <6d0b732ae8cf027cfdc5e4f73b2fe5c3@localhost.localdomain>
Download mbox | patch
Permalink /patch/31351/
State Not Applicable
Headers show

Comments

phabricator - May 8, 2018, 1:34 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2cdae2582d8a: tests: port test-minifileset.py to Python 3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3472?vs=8499&id=8527

REVISION DETAIL
  https://phab.mercurial-scm.org/D3472

AFFECTED FILES
  contrib/python3-whitelist
  tests/test-minifileset.py

CHANGE DETAILS




To: durin42, pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-minifileset.py b/tests/test-minifileset.py
--- a/tests/test-minifileset.py
+++ b/tests/test-minifileset.py
@@ -18,21 +18,24 @@ 
         if f(*args):
             print('unexpected: %r should exclude %r' % (text, args))
 
-check('all()', [('a.php', 123), ('b.txt', 0)], [])
-check('none()', [], [('a.php', 123), ('b.txt', 0)])
-check('!!!!((!(!!all())))', [], [('a.php', 123), ('b.txt', 0)])
+check(b'all()', [(b'a.php', 123), (b'b.txt', 0)], [])
+check(b'none()', [], [(b'a.php', 123), (b'b.txt', 0)])
+check(b'!!!!((!(!!all())))', [], [(b'a.php', 123), (b'b.txt', 0)])
 
-check('"path:a" & (**.b | **.c)', [('a/b.b', 0), ('a/c.c', 0)], [('b/c.c', 0)])
-check('(path:a & **.b) | **.c',
-      [('a/b.b', 0), ('a/c.c', 0), ('b/c.c', 0)], [])
+check(b'"path:a" & (**.b | **.c)',
+      [(b'a/b.b', 0), (b'a/c.c', 0)], [(b'b/c.c', 0)])
+check(b'(path:a & **.b) | **.c',
+      [(b'a/b.b', 0), (b'a/c.c', 0), (b'b/c.c', 0)], [])
 
-check('**.bin - size("<20B")', [('b.bin', 21)], [('a.bin', 11), ('b.txt', 21)])
+check(b'**.bin - size("<20B")',
+      [(b'b.bin', 21)], [(b'a.bin', 11), (b'b.txt', 21)])
 
-check('!!**.bin or size(">20B") + "path:bin" or !size(">10")',
-      [('a.bin', 11), ('b.txt', 21), ('bin/abc', 11)],
-      [('a.notbin', 11), ('b.txt', 11), ('bin2/abc', 11)])
+check(b'!!**.bin or size(">20B") + "path:bin" or !size(">10")',
+      [(b'a.bin', 11), (b'b.txt', 21), (b'bin/abc', 11)],
+      [(b'a.notbin', 11), (b'b.txt', 11), (b'bin2/abc', 11)])
 
-check('(**.php and size(">10KB")) | **.zip | ("path:bin" & !"path:bin/README") '
-      ' | size(">1M")',
-      [('a.php', 15000), ('a.zip', 0), ('bin/a', 0), ('bin/README', 1e7)],
-      [('a.php', 5000), ('b.zip2', 0), ('t/bin/a', 0), ('bin/README', 1)])
+check(
+    b'(**.php and size(">10KB")) | **.zip | ("path:bin" & !"path:bin/README") '
+    b' | size(">1M")',
+    [(b'a.php', 15000), (b'a.zip', 0), (b'bin/a', 0), (b'bin/README', 1e7)],
+    [(b'a.php', 5000), (b'b.zip2', 0), (b't/bin/a', 0), (b'bin/README', 1)])
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -256,6 +256,7 @@ 
 test-merge7.t
 test-merge8.t
 test-merge9.t
+test-minifileset.py
 test-mq-git.t
 test-mq-header-date.t
 test-mq-header-from.t