|
|
|
@ -40,8 +40,9 @@ contract('SafeMath', function(accounts) { |
|
|
|
|
try { |
|
|
|
|
let subtract = await safeMath.subtract(a, b); |
|
|
|
|
} catch(error) { |
|
|
|
|
assertJump(error); |
|
|
|
|
return assertJump(error); |
|
|
|
|
} |
|
|
|
|
assert.fail('should have thrown before'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it("should throw an error on addition overflow", async function() { |
|
|
|
@ -50,8 +51,9 @@ contract('SafeMath', function(accounts) { |
|
|
|
|
try { |
|
|
|
|
let add = await safeMath.add(a, b); |
|
|
|
|
} catch(error) { |
|
|
|
|
assertJump(error); |
|
|
|
|
return assertJump(error); |
|
|
|
|
} |
|
|
|
|
assert.fail('should have thrown before'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it("should throw an error on multiplication overflow", async function() { |
|
|
|
@ -60,8 +62,9 @@ contract('SafeMath', function(accounts) { |
|
|
|
|
try { |
|
|
|
|
let multiply = await safeMath.multiply(a, b); |
|
|
|
|
} catch(error) { |
|
|
|
|
assertJump(error); |
|
|
|
|
return assertJump(error); |
|
|
|
|
} |
|
|
|
|
assert.fail('should have thrown before'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|