py3: replace file() with open() in test-fileset.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2127
--- a/tests/test-fileset.t Sun Feb 11 17:11:45 2018 +0530
+++ b/tests/test-fileset.t Sun Feb 11 17:12:28 2018 +0530
@@ -180,7 +180,7 @@
Test files properties
- >>> file('bin', 'wb').write('\0a')
+ >>> open('bin', 'wb').write(b'\0a')
$ fileset 'binary()'
$ fileset 'binary() and unknown()'
bin
@@ -219,8 +219,8 @@
$ hg --config ui.portablefilenames=ignore add con.xml
#endif
- >>> file('1k', 'wb').write(' '*1024)
- >>> file('2k', 'wb').write(' '*2048)
+ >>> open('1k', 'wb').write(b' '*1024)
+ >>> open('2k', 'wb').write(b' '*2048)
$ hg add 1k 2k
$ fileset 'size("bar")'
hg: parse error: couldn't parse size: bar