Coverage for tsfpga/test/unit/test_hdl_file.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2022-11-29 20:01 +0000

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

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

3# 

4# This file is part of the tsfpga project, a project platform for modern FPGA development. 

5# https://tsfpga.com 

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

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

8 

9# Standard libraries 

10from pathlib import Path 

11 

12# First party libraries 

13from tsfpga.hdl_file import HdlFile 

14 

15 

16def test_file_type(): 

17 assert HdlFile(Path("file.vhd")).is_vhdl 

18 assert not HdlFile(Path("file.vhd")).is_verilog_source 

19 assert not HdlFile(Path("file.vhd")).is_verilog_header 

20 

21 assert HdlFile(Path("file.vh")).is_verilog_header 

22 assert HdlFile(Path("file.v")).is_verilog_source 

23 

24 

25def test_can_cast_to_string_without_error(): 

26 str(HdlFile(Path("file.vhd")))