Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzz range branch #21

Open
wants to merge 21 commits into
base: master
from
Open
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Add path fuzzer

  • Loading branch information
bookmoons committed Nov 9, 2019
commit 13c58a30da0c4c07a92c6164c8af039a58286464
@@ -0,0 +1,29 @@
const path = require('path')

async function fuzz (bytes) {
const string = String.fromCodePoint(...bytes)
try {
path.basename(string)
path.dirname(string)
path.extname(string)
path.isAbsolute(string)
path.join(string)
path.normalize(string)
path.parse(string)
path.resolve(string)
path.toNamespacedPath(string)
} catch (error) {
if (!acceptable(error)) throw error
}
}

function acceptable (error) {
return !!expected
.find(message => error.message.startsWith(message))
}

const expected = [

]

exports.fuzz = fuzz
@@ -0,0 +1,6 @@
{
"name": "path-fuzz",
"version": "1.0.0",
"main": "fuzz.js",
"license": "ISC"
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.