fix(test): expect paren-less DSL from the installer - #73
Merged
Conversation
`bb` was exporting its `locals_without_parens` under a misspelled key, so the formatter added brackets to generated DSL calls. With that corrected, the installer emits the house style and these expectations were stale.
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.
Companion to beam-bots/bb#211, which fixes #202.
bb's.formatter.exsexported itslocals_without_parenslist under themisspelled key
locals_without_parems, so anything reading that export got anempty list. Each installer calls
Formatter.import_dep/2, which writesimport_deps: [:bb]into the igniter test project — so the robot modulegenerated during these tests was formatted with no
locals_without_parensatall, and the formatter added brackets to every DSL call.
With the export corrected the installer emits the house style from
usage-rules/dsl-topology.md(type :revolute, nottype(:revolute)), sothese expectations were stale. Only the assertion strings change; the installer
itself is untouched.
Ordering
This cannot merge before
bbships the fix. These assertions are redagainst hex
bb0.25.0 and green only against abbthat carries thecorrected export. Verified locally with
BB_VERSION=local:mix check --no-retrypasses in full.Note on brittleness
Igniter.Testhas no AST-aware content assertion —assert_has_patch/3,assert_creates/3,assert_content_equals/3andassert_unchanged/1,2are allstring- or diff-based.
sanitize_diff/2trims each line, so indentationchanges are absorbed, but line content and line breaks are significant. That's
why a paren-style change breaks these and not, say, a rewrap. A
formatting-independent version is possible on top of
Igniter.Code.Common.move_to_cursor_match_in_scope/2, but it needs sharedtest-support code that doesn't exist yet; not done here.