1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2026-04-24 11:16:38 +00:00

isProbablyBinary() used for uploading files

This commit is contained in:
Steven Hugg
2018-12-07 17:24:27 -05:00
parent c6f2382f26
commit 4b8d7406b0
5 changed files with 62 additions and 29 deletions
+9
View File
@@ -110,3 +110,12 @@ describe('LZG', function() {
assert.equal(40976, rom.length);
});
});
describe('string functions', function() {
it('Should detect binary', function() {
assert.ok(!util.isProbablyBinary([32,32,10,13,9,32,32,10,13]));
assert.ok(util.isProbablyBinary([32,32,0x80]));
assert.ok(!util.isProbablyBinary([32,32,0xc1,0x81,32,32,10,13]));
assert.ok(util.isProbablyBinary(NES_CONIO_ROM_LZG));
});
});