diff --git a/Gruntfile.js b/Gruntfile.js index 4efcd11..febecc5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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'] diff --git a/tasks/webfont.js b/tasks/webfont.js index 742c458..e793f21 100755 --- a/tasks/webfont.js +++ b/tasks/webfont.js @@ -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; diff --git a/test/src_filename_length/length.svg b/test/src_filename_length/length.svg new file mode 100644 index 0000000..b87aebe --- /dev/null +++ b/test/src_filename_length/length.svg @@ -0,0 +1,2 @@ + +length diff --git a/test/webfont_test.js b/test/webfont_test.js index f8bde54..550c79c 100644 --- a/test/webfont_test.js +++ b/test/webfont_test.js @@ -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(); }