Class: VhdlDoctest::TestCase
- Inherits:
-
Object
- Object
- VhdlDoctest::TestCase
- Defined in:
- lib/vhdl_doctest/test_case.rb
Instance Attribute Summary collapse
-
#in_mapping ⇒ Object
readonly
Returns the value of attribute in_mapping.
-
#out_mapping ⇒ Object
readonly
Returns the value of attribute out_mapping.
Instance Method Summary collapse
-
#initialize(mapping) ⇒ TestCase
constructor
A new instance of TestCase.
- #to_vhdl ⇒ Object
Constructor Details
#initialize(mapping) ⇒ TestCase
Returns a new instance of TestCase.
4 5 6 7 8 9 10 |
# File 'lib/vhdl_doctest/test_case.rb', line 4 def initialize(mapping) @in_mapping, @out_mapping = mapping.partition{ |port, _| port.in? } if @in_mapping.find { |_, v| v == :dont_care } raise NotImplementedError.new("Don't care for input value is not supported") end @out_mapping.select!{ |k, v| v != :dont_care } end |
Instance Attribute Details
#in_mapping ⇒ Object (readonly)
Returns the value of attribute in_mapping.
3 4 5 |
# File 'lib/vhdl_doctest/test_case.rb', line 3 def in_mapping @in_mapping end |
#out_mapping ⇒ Object (readonly)
Returns the value of attribute out_mapping.
3 4 5 |
# File 'lib/vhdl_doctest/test_case.rb', line 3 def out_mapping @out_mapping end |
Instance Method Details
#to_vhdl ⇒ Object
12 13 14 |
# File 'lib/vhdl_doctest/test_case.rb', line 12 def to_vhdl stimuli.join("\n") + "wait for 10 ns;\n" + assertion end |