Name an assertion/property
See original GitHub issueAs far as I can see, when a test is run the failed message returns the actual and expected values, but there is no name of the property shown.
So if I say
5.Should().Be(10);
It returns “Message: Expected 10, but found 5”, but if you have multiple assertions you have no idea which one failed.
Could you not add a named property to Should or a fluent method like .Named(string name) and then add the name to the output messages. I think this would work well and could look like:
5.Should("some number").Be(10);
5.Should().Named("some number").Be(10)
would give “some number: Expected 10, but found 5”
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
SystemVerilog Assertions Tutorial
In SystemVerilog there are two kinds of assertions: immediate (assert) and concurrent (assert property). · Immediate assertions are procedural statements and are ...
Read more >SystemVerilog Assertions
The behavior of a system can be written as an assertion that should be true at all times. Hence assertions are used to...
Read more >SystemVerilog Assertions Basics
SystemVerilog Assertions (SVA) is essentially a language construct which provides a powerful alternate way to write constraints, checkers and cover points ...
Read more >Using SystemVerilog Assertions in RTL Code
An assertion is an instruction to a verification tool to check a property. Properties can be checked dynamically by simulators such as VCS,...
Read more >Assertions in SystemVerilog Immediate and Concurrent
An assertion is a check embedded in design or bound to a design unit during the simulation. Warnings or errors are generated on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Although I recognize the possible usefulness of the idea, I think by now we have enough tools to help us identify the failed assertion.
because
parameter?@mika76 Would you agree that adding functionality you described would bring little gain in some very specific cases? In that case, you could close the issue.
@krajek it seems subject does exactly what I originally wanted. This is great! Will close.