core: (attr assembly fmt) add whitespace directive#6248
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6248 +/- ##
=======================================
Coverage 86.88% 86.89%
=======================================
Files 431 431
Lines 64599 64628 +29
Branches 7396 7402 +6
=======================================
+ Hits 56130 56159 +29
Misses 6897 6897
Partials 1572 1572 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| def test_error_invalid_whitespace(): | ||
| with pytest.raises(ParseError, match="unexpected whitespace in directive"): | ||
| _program("` `") | ||
|
|
||
|
|
||
| def test_error_not_a_whitespace_directive(): | ||
| with pytest.raises(ParseError, match="expected a whitespace directive"): | ||
| _program("`+`") |
There was a problem hiding this comment.
these can be fused with test_error_unexpected_token above, when parametrized
| def test_whitespace_print(format_str: str, expected: str): | ||
| assert _print(format_str) == expected |
There was a problem hiding this comment.
these can be fused with test_empty_format_prints_and_parses_nothing above, when parametrized, and could test the output of Parser.parse_type.
| def test_whitespace_parses_to_directive_and_consumes_nothing(): | ||
| assert _program("` `").stmts == (AttrWhitespaceDirective(" "),) | ||
| assert _parse("` `", "") == [] | ||
|
|
There was a problem hiding this comment.
Feels like it would be worth parametrizing this test also, to cover the three cases in the test above.
There was a problem hiding this comment.
Actually, I can't find a matching test op-side so we might not want it.
Adds
AttrWhitespaceDirectiveto declarative assembly format for attributes.WIP: