mirror of
https://github.com/less/less.js.git
synced 2026-02-08 22:15:04 -05:00
Allow comparing colors and strings. Fix a bug whereby sometimes a mixin-call or import would disappear. This makes the import test fail consistently instead of once out of 8 times depending on async order I think.
This commit is contained in:
@@ -56,3 +56,13 @@
|
||||
content: not false;
|
||||
content: not false and false, not false;
|
||||
}
|
||||
.colorguardtest {
|
||||
content: is #ff0000;
|
||||
content: is not #0000ff its #ff0000;
|
||||
content: is not #0000ff its #800080;
|
||||
}
|
||||
.stringguardtest {
|
||||
content: is theme1;
|
||||
content: is not theme2;
|
||||
content: is theme1 no quotes;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ fs.readdirSync('test/less').forEach(function (file) {
|
||||
else if (err) {
|
||||
sys.print(stylize("ERROR: " + (err && err.message), 'red'));
|
||||
} else {
|
||||
sys.print(stylize("FAIL", 'yellow'));
|
||||
sys.print(stylize("FAIL", 'yellow') + '\n');
|
||||
|
||||
require('diff').diffLines(css, less).forEach(function(item) {
|
||||
if(item.added || item.removed) {
|
||||
|
||||
@@ -92,3 +92,22 @@
|
||||
.bool () when not (false) and (false), not (false) { content: not false and false, not false }
|
||||
|
||||
.bool1 { .bool }
|
||||
|
||||
.colorguard(@col) when (@col = red) { content: is @col; }
|
||||
.colorguard(@col) when not (blue = @col) { content: is not blue its @col; }
|
||||
.colorguard(@col) {}
|
||||
.colorguardtest {
|
||||
.colorguard(red);
|
||||
.colorguard(blue);
|
||||
.colorguard(purple);
|
||||
}
|
||||
|
||||
.stringguard(@str) when (@str = "theme1") { content: is theme1; }
|
||||
.stringguard(@str) when not ("theme2" = @str) { content: is not theme2; }
|
||||
.stringguard(@str) when (~"theme1" = @str) { content: is theme1 no quotes; }
|
||||
.stringguard(@str) {}
|
||||
.stringguardtest {
|
||||
.stringguard("theme1");
|
||||
.stringguard("theme2");
|
||||
.stringguard(theme1);
|
||||
}
|
||||
Reference in New Issue
Block a user