File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ import pytest
2+ from hdltools .hdl_detect import HdlDetect
3+
4+
5+ code = {
6+ 'vhdl' : """
7+ library IEEE;
8+ use IEEE.STD_LOGIC_1164.ALL;
9+
10+ entity Example is
11+ Port (
12+ data_i : in STD_LOGIC;
13+ data_o : out STD_LOGIC
14+ );
15+ end Example;
16+
17+ architecture Behavioral of Example is
18+ begin
19+ data_o <= data_i;
20+ end Behavioral;
21+ """ ,
22+ 'vlog' : """
23+ module Example (
24+ input data_i,
25+ output data_o
26+ );
27+ assign data_o = data_i;
28+ endmodule
29+ """ ,
30+ 'slog' : """
31+ module Example (
32+ input logic data_i,
33+ output logic data_o
34+ );
35+ assign data_o = data_i;
36+ endmodule
37+ """
38+ }
39+
40+
41+ @pytest .mark .parametrize ("lang" , ['vhdl' , 'vlog' , 'slog' ])
42+ def test_detect (lang ):
43+ obj = HdlDetect (code [lang ])
44+ assert obj .get_lang () == lang
You can’t perform that action at this time.
0 commit comments