Show More
@@ -90,6 +90,30 b' class ifileindextests(basetestcase):' | |||||
90 | with self.assertRaises(error.LookupError): |
|
90 | with self.assertRaises(error.LookupError): | |
91 | f.lookup(b'%d' % nullrev) |
|
91 | f.lookup(b'%d' % nullrev) | |
92 |
|
92 | |||
|
93 | with self.assertRaises(error.LookupError): | |||
|
94 | f.lookup(b'badvalue') | |||
|
95 | ||||
|
96 | self.assertEqual(f.lookup(hex(nullid)[0:12]), nullid) | |||
|
97 | ||||
|
98 | with self.assertRaises(error.LookupError): | |||
|
99 | f.lookup(b'-2') | |||
|
100 | ||||
|
101 | # TODO this is wonky. | |||
|
102 | self.assertEqual(f.lookup(b'0'), nullid) | |||
|
103 | ||||
|
104 | with self.assertRaises(error.LookupError): | |||
|
105 | f.lookup(b'1') | |||
|
106 | ||||
|
107 | with self.assertRaises(error.LookupError): | |||
|
108 | f.lookup(b'11111111111111111111111111111111111111') | |||
|
109 | ||||
|
110 | for i in range(-5, 5): | |||
|
111 | if i == nullrev: | |||
|
112 | continue | |||
|
113 | ||||
|
114 | with self.assertRaises(LookupError): | |||
|
115 | f.lookup(i) | |||
|
116 | ||||
93 | self.assertEqual(f.linkrev(nullrev), nullrev) |
|
117 | self.assertEqual(f.linkrev(nullrev), nullrev) | |
94 |
|
118 | |||
95 | for i in range(-5, 5): |
|
119 | for i in range(-5, 5): | |
@@ -170,8 +194,22 b' class ifileindextests(basetestcase):' | |||||
170 |
|
194 | |||
171 | self.assertEqual(f.lookup(node), node) |
|
195 | self.assertEqual(f.lookup(node), node) | |
172 | self.assertEqual(f.lookup(0), node) |
|
196 | self.assertEqual(f.lookup(0), node) | |
|
197 | self.assertEqual(f.lookup(-1), nullid) | |||
173 | self.assertEqual(f.lookup(b'0'), node) |
|
198 | self.assertEqual(f.lookup(b'0'), node) | |
174 | self.assertEqual(f.lookup(hex(node)), node) |
|
199 | self.assertEqual(f.lookup(hex(node)), node) | |
|
200 | self.assertEqual(f.lookup(hex(node)[0:12]), node) | |||
|
201 | ||||
|
202 | with self.assertRaises(IndexError): | |||
|
203 | f.lookup(-2) | |||
|
204 | ||||
|
205 | with self.assertRaises(error.LookupError): | |||
|
206 | f.lookup(b'-2') | |||
|
207 | ||||
|
208 | with self.assertRaises(IndexError): | |||
|
209 | f.lookup(1) | |||
|
210 | ||||
|
211 | with self.assertRaises(error.LookupError): | |||
|
212 | f.lookup(b'1') | |||
175 |
|
213 | |||
176 | self.assertEqual(f.linkrev(0), 0) |
|
214 | self.assertEqual(f.linkrev(0), 0) | |
177 |
|
215 |
General Comments 0
You need to be logged in to leave comments.
Login now