Added Dynamic RAM calculation unit tests

This commit is contained in:
danielyxie
2019-05-10 02:24:50 -07:00
parent db5fdb1fcb
commit 9dd68947f1
9 changed files with 1436 additions and 22 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ const HacknetNamespaceCost = RamCostConstants.ScriptHacknetNodesRamCost;
describe("Netscript Static RAM Calculation/Generation Tests", function() {
// Tests numeric equality, allowing for floating point imprecision
function testEquality(val, expected) {
expect(val).to.be.within(expected - 10 * Number.EPSILON, expected + 10 * Number.EPSILON);
expect(val).to.be.within(expected - 100 * Number.EPSILON, expected + 100 * Number.EPSILON);
}
/**