equal
deleted
inserted
replaced
|
1 from __future__ import absolute_import |
|
2 |
|
3 import unittest |
|
4 |
|
5 import silenttestrunner |
|
6 |
|
7 from mercurial import util |
|
8 |
|
9 |
|
10 class dirstests(unittest.TestCase): |
|
11 def testdirs(self): |
|
12 for case, want in [ |
|
13 (b'a/a/a', [b'a', b'a/a', b'']), |
|
14 (b'alpha/beta/gamma', [b'', b'alpha', b'alpha/beta']), |
|
15 ]: |
|
16 d = util.dirs({}) |
|
17 d.addpath(case) |
|
18 self.assertEqual(sorted(d), sorted(want)) |
|
19 |
|
20 def testinvalid(self): |
|
21 with self.assertRaises(ValueError): |
|
22 d = util.dirs({}) |
|
23 d.addpath(b'a//b') |
|
24 |
|
25 |
|
26 if __name__ == '__main__': |
|
27 silenttestrunner.main(__name__) |