mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1860205 - Add tests for negation of a round() node. r=firefox-style-system-reviewers,emilio
Depends on D192742 Differential Revision: https://phabricator.services.mozilla.com/D192760
This commit is contained in:
parent
092e43b900
commit
bd4c1c5cab
@ -71,6 +71,46 @@ test_math_used("round(down, -10px, 5px)", "-10px");
|
||||
test_math_used("round(up, -10px, 5px)", "-10px");
|
||||
test_math_used("round(to-zero, -10px, 5px)", "-10px");
|
||||
|
||||
// Test negation of the round operation
|
||||
test_math_used("calc(0px - round(23px, 10px))", "-20px");
|
||||
test_math_used("calc(0px - round(18px, 10px))", "-20px");
|
||||
test_math_used("calc(0px - round(15px, 10px))", "-20px");
|
||||
test_math_used("calc(0px - round(13px, 10px))", "-10px");
|
||||
test_math_used("calc(0px - round(-13px, 10px))", "10px");
|
||||
test_math_used("calc(0px - round(-18px, 10px))", "20px");
|
||||
|
||||
// Test negation of nearest
|
||||
test_math_used("calc(0px - round(nearest, 23px, 10px))", "-20px");
|
||||
test_math_used("calc(0px - round(nearest, 18px, 10px))", "-20px");
|
||||
test_math_used("calc(0px - round(nearest, 15px, 10px))", "-20px");
|
||||
test_math_used("calc(0px - round(nearest, 13px, 10px))", "-10px");
|
||||
test_math_used("calc(0px - round(nearest, -13px, 10px))", "10px");
|
||||
test_math_used("calc(0px - round(nearest, -18px, 10px))", "20px");
|
||||
|
||||
// Test negation of down
|
||||
test_math_used("calc(0px - round(down, 23px, 10px))", "-20px");
|
||||
test_math_used("calc(0px - round(down, 18px, 10px))", "-10px");
|
||||
test_math_used("calc(0px - round(down, 15px, 10px))", "-10px");
|
||||
test_math_used("calc(0px - round(down, 13px, 10px))", "-10px");
|
||||
test_math_used("calc(0px - round(down, -13px, 10px))", "20px");
|
||||
test_math_used("calc(0px - round(down, -18px, 10px))", "20px");
|
||||
|
||||
// Test negation of up
|
||||
test_math_used("calc(0px - round(up, 23px, 10px))", "-30px");
|
||||
test_math_used("calc(0px - round(up, 18px, 10px))", "-20px");
|
||||
test_math_used("calc(0px - round(up, 15px, 10px))", "-20px");
|
||||
test_math_used("calc(0px - round(up, 13px, 10px))", "-20px");
|
||||
test_math_used("calc(0px - round(up, -13px, 10px))", "10px");
|
||||
test_math_used("calc(0px - round(up, -18px, 10px))", "10px");
|
||||
|
||||
// Test negation of to-zero
|
||||
test_math_used("calc(0px - round(to-zero, 23px, 10px))", "-20px");
|
||||
test_math_used("calc(0px - round(to-zero, 18px, 10px))", "-10px");
|
||||
test_math_used("calc(0px - round(to-zero, 15px, 10px))", "-10px");
|
||||
test_math_used("calc(0px - round(to-zero, 13px, 10px))", "-10px");
|
||||
test_math_used("calc(0px - round(to-zero, -13px, 10px))", "10px");
|
||||
test_math_used("calc(0px - round(to-zero, -18px, 10px))", "10px");
|
||||
|
||||
// Extreme cases:
|
||||
|
||||
// 0 step is NaN
|
||||
|
Loading…
Reference in New Issue
Block a user