From 65c8d26d41c98e4c903cc93037e2a6b01d930548 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 20 Oct 2025 11:24:21 -0700 Subject: [PATCH] chore: add test for number with underscore parsing In Less.js 2.6.0, parsing of dimensions changed so that `5_large` is seen as one value, instead of as a list containing "5" and "_large". In updating the Less.php port, we forgot to consider this change because none of the Less.js 3.13 tests seem to cover this behavior. Follows-up https://github.com/less/less.js/pull/2485. This adds the test case from https://github.com/less/less.js/issues/2462, as inpired by downstream https://gerrit.wikimedia.org/r/1197310. --- packages/test-data/css/_main/variables.css | 3 +++ packages/test-data/less/_main/variables.less | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/packages/test-data/css/_main/variables.css b/packages/test-data/css/_main/variables.css index 6afac9b39..79f2cef83 100644 --- a/packages/test-data/css/_main/variables.css +++ b/packages/test-data/css/_main/variables.css @@ -95,3 +95,6 @@ div#carrot { div#potato { color: blue; } +.icon-5_large { + background-image: url(/img/icon/5_large.svg); +} diff --git a/packages/test-data/less/_main/variables.less b/packages/test-data/less/_main/variables.less index c03d1bff4..aa7a1686f 100644 --- a/packages/test-data/less/_main/variables.less +++ b/packages/test-data/less/_main/variables.less @@ -159,3 +159,9 @@ each(@items, { color: blue; } }) + +// https://github.com/less/less.js/issues/2462 +@type: 5_large; +.icon-@{type} { + background-image: ~"url(/img/icon/@{type}.svg)"; +}