Skip to content

Commit

Permalink
Add a test case for calc and strictMath.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Aug 9, 2016
1 parent a4ef5e1 commit 5501c3b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ module.exports = function(grunt) {
'tmp/customFunctions.css': ['test/fixtures/customFunctions.less']
}
},
calc: {
options: {
strictMath: true
},
src: 'test/fixtures/calc.less',
dest: 'tmp/calc.css'
},
modifyVars: {
options: {
modifyVars: {
Expand Down
3 changes: 3 additions & 0 deletions test/expected/calc.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.a {
padding-top: calc(var(--header-height) + 1rem);
}
3 changes: 3 additions & 0 deletions test/fixtures/calc.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.a {
padding-top: calc(var(--header-height) + 1rem);
}
9 changes: 9 additions & 0 deletions test/less_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ exports.less = {

test.done();
},
calc: function(test) {
test.expect(1);

var actual = read('tmp/calc.css');
var expected = read('test/expected/calc.css');
test.equal(expected, actual, 'should process calc function with `strictMath`');

test.done();
},
customFunctions: function(test) {
test.expect(1);

Expand Down

0 comments on commit 5501c3b

Please sign in to comment.