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.vivado.hierarchical_utilization_parser import HierarchicalUtilizationParser 

10 

11 

12def test_utilization_parser(): 

13 report = """ 

14Writing top or top) or (top here should not cause issues 

15Also writing pipes | | | | should be fine 

16Random sections of dashes should be fine: 

17--------------------------------------------------------------- 

18-----------------------+----------------------------+---------- 

19But this should hit: 

20| x | x | a | b | c | d | 

21~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

22| x | (top) | 1 | 2 | 3 | 4 | 

23""" 

24 

25 result = HierarchicalUtilizationParser.get_size(report) 

26 assert result["a"] == 1 

27 assert result["b"] == 2 

28 assert result["c"] == 3 

29 assert result["d"] == 4 

30 assert len(result) == 4