Skip to content

Commit 7da33d5

Browse files
committed
added calc subtraction test
1 parent c18ebe6 commit 7da33d5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

test/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const { dependencies } = JSON.parse(fs.readFileSync(new URL("../package.json", i
2626

2727
assert.strictEqual(source.includes(`import "./index.css"`), false, "the css import should be removed.");
2828
assert.strictEqual(style.includes(`.element{box-shadow:0px 16px 32px -10px rgba(17,24,38,0.1);}`), true, "negative values should be minified correctly.");
29-
assert.strictEqual(style.includes(`.test{top:calc(var(--variable-name));top: calc(var(--variable-name) + 10px);top: calc((10px + var(--variable-name)) * 2);}`), true, "nested parentheses should be minfied correctly.");
29+
assert.strictEqual(style.includes(`.test{top:calc(var(--variable-name));top: calc(var(--variable-name) + 10px);top: calc(var(--variable-name) - 10px);top: calc((10px + var(--variable-name)) * 2);}`), true, "nested parentheses should be minfied correctly.");
3030
assert.strictEqual(style.includes(`:is(.a-very-long-class-name,.b-very-long-class-name,.c-very-long-class-name) textarea{margin:0;}`), true, "new lines should be minified correctly.");
3131
assert.strictEqual(style.includes(`html[style*="--color-scheme: dark"]{color:blue;}`), true, "spaces should be preserved in css selectors.");
3232
assert.strictEqual(style.includes(`.bg-image-relative{background-image:url("./assets/background-updated.jpg");`), true, "relative asset paths should be updated.");

test/src/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
.test {
1010
top: calc(var(--variable-name));
1111
top: calc(var(--variable-name) + 10px);
12+
top: calc(var(--variable-name) - 10px);
1213
top: calc((10px + var(--variable-name)) * 2);
1314
}
1415

0 commit comments

Comments
 (0)