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

svg cannot have have filename 'length' #364

Merged
merged 1 commit into from
May 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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