agent updates
This commit is contained in:
21
test/gravity.test.js
Normal file
21
test/gravity.test.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
const gravity = require('../src/helper/gravity.js');
|
||||
|
||||
test('standard gravity constant is available', () => {
|
||||
assert.ok(Math.abs(gravity.getStandardGravity() - 9.80665) < 1e-9);
|
||||
});
|
||||
|
||||
test('local gravity decreases with elevation', () => {
|
||||
const seaLevel = gravity.getLocalGravity(45, 0);
|
||||
const high = gravity.getLocalGravity(45, 1000);
|
||||
assert.ok(high < seaLevel);
|
||||
});
|
||||
|
||||
test('pressureHead and weightForce use local gravity', () => {
|
||||
const dp = gravity.pressureHead(1000, 5, 45, 0);
|
||||
const force = gravity.weightForce(2, 45, 0);
|
||||
assert.ok(dp > 0);
|
||||
assert.ok(force > 0);
|
||||
});
|
||||
Reference in New Issue
Block a user