Skip to content

Commit 27a9bb5

Browse files
committed
test: backfill formatting coverage for all selector combinators
1 parent 278edb5 commit 27a9bb5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/syntax_tree/css/format.rb

+4
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ def visit_combinator(node)
111111
case node.value
112112
when WhitespaceToken
113113
q.text(" ")
114+
when Array
115+
q.text(" ")
116+
node.value.each { |val| val.format(q) }
117+
q.text(" ")
114118
else
115119
q.text(" ")
116120
node.value.format(q)

test/selectors_test.rb

+7
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ class SelectorsTest < Minitest::Spec
251251
".outer section.foo > table.bar tr",
252252
)
253253
end
254+
255+
it "handles all the combinators" do
256+
assert_selector_format(
257+
"a b > c + d ~ e || f",
258+
"a b > c + d ~ e || f",
259+
)
260+
end
254261
end
255262

256263
private

0 commit comments

Comments
 (0)