Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# -------------------------------------------------------------------------------------------------- 

2# Copyright (c) Lukas Vik. All rights reserved. 

3# 

4# This file is part of the tsfpga project. 

5# https://tsfpga.com 

6# https://gitlab.com/tsfpga/tsfpga 

7# -------------------------------------------------------------------------------------------------- 

8 

9from tsfpga.registers.constant import Constant 

10 

11 

12def test_repr(): 

13 # Check that repr is an actual representation, not just "X object at 0xABCDEF" 

14 assert "apa" in repr(Constant(name="apa", value=0)) 

15 

16 # Different name 

17 assert repr(Constant(name="apa", value=0)) != repr(Constant(name="hest", value=0)) 

18 

19 # Different value 

20 assert repr(Constant(name="apa", value=0)) != repr(Constant(name="apa", value=1)) 

21 

22 # Different description 

23 assert repr(Constant(name="apa", value=0, description="Blah")) != repr( 

24 Constant(name="apa", value=0, description="Gaah") 

25 )