Fix coding style in test/unit/crypto_spec.js
This commit is contained in:
parent
6489a80dd0
commit
9e3f7e4d6d
@ -9,8 +9,9 @@ describe('crypto', function() {
|
|||||||
function string2binary(s) {
|
function string2binary(s) {
|
||||||
var n = s.length, i;
|
var n = s.length, i;
|
||||||
var result = new Uint8Array(n);
|
var result = new Uint8Array(n);
|
||||||
for (i = 0; i < n; ++i)
|
for (i = 0; i < n; ++i) {
|
||||||
result[i] = s.charCodeAt(i) % 0xFF;
|
result[i] = s.charCodeAt(i) % 0xFF;
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,19 +227,19 @@ describe('CipherTransformFactory', function() {
|
|||||||
describe('#ctor', function() {
|
describe('#ctor', function() {
|
||||||
it('should accept user password', function() {
|
it('should accept user password', function() {
|
||||||
var factory = new CipherTransformFactory(new DictMock(map1), fileID1,
|
var factory = new CipherTransformFactory(new DictMock(map1), fileID1,
|
||||||
'123456');
|
'123456');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should accept owner password', function() {
|
it('should accept owner password', function() {
|
||||||
var factory = new CipherTransformFactory(new DictMock(map1), fileID1,
|
var factory = new CipherTransformFactory(new DictMock(map1), fileID1,
|
||||||
'654321');
|
'654321');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not accept wrong password', function() {
|
it('should not accept wrong password', function() {
|
||||||
var thrown = false;
|
var thrown = false;
|
||||||
try {
|
try {
|
||||||
var factory = new CipherTransformFactory(new DictMock(map1), fileID1,
|
var factory = new CipherTransformFactory(new DictMock(map1), fileID1,
|
||||||
'wrong');
|
'wrong');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
thrown = true;
|
thrown = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user