Allow 'then error' without a reason - #48
Conversation
'then error' required a string, so a scenario that only asserts that an operation was rejected had to write 'then error ""'. Most rejection scenarios are that shape - the reason lives in the specification's name, not in the assertion - and an empty string reads as a reason left blank rather than one never stated. The message becomes optional and the name becomes nullable, so the two cases stay distinguishable: null is "rejected, reason unspecified here", empty string is still an empty message.
|
Reviewer notes — left open for a call on the design, not merged, since it is a language decision. Answering the two questions raised in #46: May a bare Does the printer round-trip a bare Scope. The regex change is Verification — |
Changed
then errorno longer requires a message. A barethen errorasserts that the scenario is rejected without naming why, which is the shape most rejection scenarios have — the reason lives in the specification's own name.then error "<message>"is unchanged for the case where a specific message is asserted. (Allow 'then error' without a reason for a rejection the specification does not name #46)SpecificationErrorSyntax.Nameis nullable, so an unnamed reason stays distinguishable from an empty one. (Allow 'then error' without a reason for a rejection the specification does not name #46)