Skip to content

fix(test): expect paren-less DSL from the installer - #73

Merged
jimsynz merged 1 commit into
mainfrom
fix/installer-test-parenless-dsl
Aug 2, 2026
Merged

fix(test): expect paren-less DSL from the installer#73
jimsynz merged 1 commit into
mainfrom
fix/installer-test-parenless-dsl

Conversation

@jimsynz

@jimsynz jimsynz commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Companion to beam-bots/bb#211, which fixes #202.

bb's .formatter.exs exported its locals_without_parens list under the
misspelled key locals_without_parems, so anything reading that export got an
empty list. Each installer calls Formatter.import_dep/2, which writes
import_deps: [:bb] into the igniter test project — so the robot module
generated during these tests was formatted with no locals_without_parens at
all, 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, not type(:revolute)), so
these expectations were stale. Only the assertion strings change; the installer
itself is untouched.

Ordering

This cannot merge before bb ships the fix. These assertions are red
against hex bb 0.25.0 and green only against a bb that carries the
corrected export. Verified locally with BB_VERSION=local:
mix check --no-retry passes in full.

Note on brittleness

Igniter.Test has no AST-aware content assertion — assert_has_patch/3,
assert_creates/3, assert_content_equals/3 and assert_unchanged/1,2 are all
string- or diff-based. sanitize_diff/2 trims each line, so indentation
changes 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 shared
test-support code that doesn't exist yet; not done here.

`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.
@jimsynz
jimsynz merged commit b8bc49b into main Aug 2, 2026
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant