Skip to content

Add failing test: CSS concat service drops @import rules#97

Merged
mreishus merged 1 commit into
mainfrom
reish20260203/show-service-drops-imports
Feb 3, 2026
Merged

Add failing test: CSS concat service drops @import rules#97
mreishus merged 1 commit into
mainfrom
reish20260203/show-service-drops-imports

Conversation

@mreishus
Copy link
Copy Markdown
Contributor

@mreishus mreishus commented Feb 3, 2026

This PR adds a unit test that exposes a bug in the CSS concatenation service where @import rules silently disappear from the output.

What the test does:

  • Creates two CSS fixtures - one plain, one with an @import
  • Builds a /_static/?? concat request against them
  • Asserts that the @import directive survives in the response

Why it fails on trunk:
The concat service tries to hoist @import (and @charset) to the top of combined output via a $pre_output buffer, but due to a closure scoping issue, those rules get stripped from the source and written to a different variable - so they vanish entirely.

Changes:

  • service.php: Adds a PAGE_OPTIMIZE_SKIP_SERVICE_REQUEST guard so the test can require the file without triggering the live service entry point.
  • tests/test-css-service-imports.php: New test case covering this scenario.

@mreishus mreishus force-pushed the reish20260203/show-service-drops-imports branch from d7139d2 to d38473c Compare February 3, 2026 16:10
@mreishus mreishus merged commit 752f971 into main Feb 3, 2026
1 of 2 checks passed
@mreishus mreishus deleted the reish20260203/show-service-drops-imports branch February 3, 2026 20:56
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