diff options
| author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 | 
|---|---|---|
| committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 | 
| commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
| tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/parse-asn1/test | |
| parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) | |
update packages
Diffstat (limited to 'node_modules/parse-asn1/test')
| -rw-r--r-- | node_modules/parse-asn1/test/index.js | 42 | 
1 files changed, 42 insertions, 0 deletions
| diff --git a/node_modules/parse-asn1/test/index.js b/node_modules/parse-asn1/test/index.js index d8bf70d47..85cb0ab4b 100644 --- a/node_modules/parse-asn1/test/index.js +++ b/node_modules/parse-asn1/test/index.js @@ -80,6 +80,33 @@ function testIt (keys) {    })  } +function testEOL (keys) { +  var publicKey = keys.public.toString() +  var newLineRegex = /\r?\n/g +  var genPrivate = function (replace) { +    if (keys.private.key) { +      return { key: keys.private.key.toString().replace(newLineRegex, replace), passphrase: keys.private.passphrase } +    } else { +      return keys.private.toString().replace(newLineRegex, replace) +    } +  } +  var testN = { +    private: genPrivate('\n'), +    public: publicKey.replace(newLineRegex, '\n') +  } +  testIt(testN) +  var testR = { +    private: genPrivate('\r'), +    public: publicKey.replace(newLineRegex, '\r') +  } +  testIt(testR) +  var testRN = { +    private: genPrivate('\r\n'), +    public: publicKey.replace(newLineRegex, '\r\n') +  } +  testIt(testRN) +} +  testIt(dsa)  testIt(dsa2)  testIt(rsa1024) @@ -94,3 +121,18 @@ testIt(rsapass2)  testIt(pass1024)  testIt(pass1024)  testIt(cert) + +testEOL(dsa) +testEOL(dsa2) +testEOL(rsa1024) +testEOL(ec) +testEOL(rsa2028) +testEOL(nonrsa1024) +testEOL(ecpass) +testEOL(dsapass) +testEOL(dsapass2) +testEOL(rsapass) +testEOL(rsapass2) +testEOL(pass1024) +testEOL(pass1024) +testEOL(cert) | 
