Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Commit

Permalink
added getNextCodepoint() fix; (#364)
Browse files Browse the repository at this point in the history
added tests
  • Loading branch information
Martynas Barzda authored and sapegin committed May 8, 2017
1 parent 36a5693 commit 015ad38
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,16 @@ module.exports = function(grunt) {
stylesheets: ['css', 'scss', 'less']
}
},
filename_length: {
src: 'test/src_filename_length/*.svg',
dest: 'test/tmp/filename_length',
options: {
autoHint: false,
engine: 'node',
hashes: false,
types: 'woff'
}
},
},
nodeunit: {
all: ['test/webfont_test.js']
Expand Down
2 changes: 1 addition & 1 deletion tasks/webfont.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ module.exports = function(grunt) {
* @return {Integer}
*/
function getNextCodepoint() {
while (_.includes(o.codepoints, currentCodepoint)) {
while (_.invert(o.codepoints).hasOwnProperty(currentCodepoint)) {
currentCodepoint++;
}
return currentCodepoint;
Expand Down
2 changes: 2 additions & 0 deletions test/src_filename_length/length.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions test/webfont_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,20 @@ exports.webfont = {
// Files should render with custom context variables
test.ok(fs.existsSync('test/tmp/custom_output/context-test.html'));

test.done();
},

filename_length: function(test) {

// File should have been created.
test.ok(fs.existsSync('test/tmp/filename_length/icons.css'));

// File should have been created.
test.ok(fs.existsSync('test/tmp/filename_length/icons.woff'));

// File should have been created.
test.ok(fs.existsSync('test/tmp/filename_length/icons.html'));

test.done();
}

Expand Down

0 comments on commit 015ad38

Please sign in to comment.