We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23b5311 commit 6e9c76fCopy full SHA for 6e9c76f
1 file changed
tests/test_detect.py
@@ -0,0 +1,44 @@
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
32
+ input logic data_i,
33
+ output logic data_o
34
35
36
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
0 commit comments