Skip to content

Commit

Permalink
test(xsnap): meter details are still available with no limit
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed May 14, 2021
1 parent 8a8ca51 commit 14c7393
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/xsnap/test/test-xs-perf.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ test('meter details', async t => {
t.is(meterType, 'xs-meter-6');
});

test('meter details are still available with no limit', async t => {
const opts = options();
const vat = xsnap({ ...opts, meteringLimit: 0 });
t.teardown(() => vat.terminate());
const result = await vat.evaluate(`
for (ix = 0; ix < 200; ix++) {
}
`);
const { meterUsage: meters } = result;
t.log(meters);
t.is(typeof meters.compute, 'number');
t.is(typeof meters.allocate, 'number');
t.true(meters.compute > 0);
t.true(meters.allocate > 0);
});

test('high resolution timer', async t => {
const opts = options();
const vat = xsnap(opts);
Expand Down

0 comments on commit 14c7393

Please sign in to comment.