Add basic tests for samsung and sony codes
This commit is contained in:
1 parent
9f29d878f8
commit
c9e4ff84d9
3 files changed
+33
-1
No files matched your search
@@ -3,3 +3,5 @@
|
|||||||
upload/
|
upload/
|
||||||
build/
|
build/
|
||||||
temp/
|
temp/
|
||||||
|
typings/
|
||||||
|
typings.json
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
var bios = require('../javascript/decrypt_bios.js');
|
||||||
|
|
||||||
|
describe("Decryp BIOS", function() {
|
||||||
|
it("Sony key for 1234567 is 9648669", function() {
|
||||||
|
expect(bios.Sony.solve("1234567")).toEqual(["9648669"]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("Sony input validation", function() {
|
||||||
|
expect(bios.Sony.check("1234")).toBe(false);
|
||||||
|
expect(bios.Sony.check("1234567")).toBe(true);
|
||||||
|
expect(bios.Sony.check("0123456")).toBe(true);
|
||||||
|
expect(bios.Sony.check("123o567")).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("Samsung key for 07088120410C0000 is 12345", function() {
|
||||||
|
expect(bios.Samsung.solve("07088120410C0000")).toEqual(["12345"]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("Samsung input validation", function() {
|
||||||
|
expect(bios.Samsung.check("07088120410C0000")).toBe(true);
|
||||||
|
expect(bios.Samsung.check("07088120410C")).toBe(true);
|
||||||
|
expect(bios.Samsung.check("07088120410C00")).toBe(true);
|
||||||
|
expect(bios.Samsung.check("0123456")).toBe(false);
|
||||||
|
expect(bios.Samsung.check("07088a20410C00")).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
+5
-1
@@ -3,9 +3,13 @@
|
|||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es3",
|
"target": "es3",
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"sourceMap": false
|
"sourceMap": false,
|
||||||
|
"outDir": "javascript/"
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
"scripts/decrypt_bios.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user