@@ -235,11 +235,23 @@ def test_integers(self):
235
235
self .check_const (1 , 1 , 1 )
236
236
self .check_const (5 , 5 , 3 )
237
237
self .check_const (1 , 1 , 5 , bitwidth = 5 )
238
+ self .check_const (0 , 0b0 , 1 )
239
+ self .check_const (0 , 0b0 , 1 , signed = True )
240
+ self .check_const (1 , 0b01 , 2 , signed = True )
241
+ self .check_const (2 , 0b010 , 3 , signed = True )
242
+ self .check_const (3 , 0b011 , 3 , signed = True )
243
+ self .check_const (4 , 0b0100 , 4 , signed = True )
244
+ self .check_const (5 , 0b0101 , 4 , signed = True )
238
245
239
246
def test_neg_integers (self ):
240
247
self .check_const (- 1 , 0b11111 , 5 , bitwidth = 5 )
241
248
self .check_const (- 2 , 0b110 , 3 , bitwidth = 3 )
242
249
self .check_const (- 5 , 0b1011 , 4 , bitwidth = 4 )
250
+ self .check_const (- 1 , 0b1 , 1 , signed = True )
251
+ self .check_const (- 2 , 0b10 , 2 , signed = True )
252
+ self .check_const (- 3 , 0b101 , 3 , signed = True )
253
+ self .check_const (- 4 , 0b100 , 3 , signed = True )
254
+ self .check_const (- 5 , 0b1011 , 4 , signed = True )
243
255
244
256
def test_too_big (self ):
245
257
self .assert_bad_const (5 , 2 )
0 commit comments