test(parser): cover scalar rvalues, block comments and COND text - #14
Merged
Merged
Conversation
The fixes in #11 and #12 landed without tests, so nothing pins the behaviour they restored. The cases go into the classes that already name the behaviour: TestSingleFloatRvalue, which until now parsed a file containing no scalar rvalue and asserted only that cells existed, TestConditionalDelays and TestCondTimingChecks. Scalar rvalues are checked in both a delay and a timing check position, since rvalue is shared, and the empty and triple forms sit in the same parametrize as non-regression cases. The round-trip assertion is what catches a scalar reaching only typ, which emits as (:5.0:) and drops the entry from critical-path and stats reporting. COND text is checked on both grammar paths, cond_delay and the timing_port COND, over scalar constants with and without a leading digit, plain integers, decimals, signed and exponent literals. One case asserts the delay values following a condition still parse as floats, which is what the contextual lexer is relied on for.
KelvinChung2000
force-pushed
the
test/parser-regression-coverage
branch
from
September 17, 2026 08:27
f4814c4 to
2603ec5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#11 and #12 landed without tests. These pin the behaviour they restored, in the classes that already name it.
tests/test_transformers.py::TestSingleFloatRvalue— scalar rvalue in a delay and in a timing check, plus the round-trip that catches a scalar reaching only typ ((:5.0:), which drops the entry from critical-path and stats).()and the full triple are in the same parametrize as non-regression cases. The class previously parsedspec-example1.sdf, which contains no scalar rvalue, and asserted only that cells existed.tests/test_transformers.py::TestConditionalDelaysand::TestCondTimingChecks— COND text on both grammar paths (cond_delayand thetiming_portCOND), over1'b0,'b1,0,1.5,-1,1e3and a&&chain, and on emit. One case asserts delay values after a condition still parse as floats.tests/test_parser.py::TestParseFile— block comments before(DELAYFILE, multi-line, trailing, and two on one line to show the non-greedy match does not swallow the text between them.Checked against the parent commits: 31 of the 64 tests in the two files fail on
0f27091^, 18 on2f8afbd^.