Skip to content

Commit

Permalink
📙🖥️: fix some test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
merryman committed Dec 16, 2024
1 parent f543c42 commit 072dd85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lively.lang/tests/array-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ describe('arr', function () {

describe('batchify', function () {
it('splits array ccording to constraint', function () {
function batchConstrained (batch) { return batch.length === 1 || sum(batch) < batchMaxSize; }
const batchMaxSize = Math.pow(2, 28)/* 256MB */;
function batchConstrained (batch) { return batch.length === 1 || sum(batch) < batchMaxSize; }
const sizes = [
Math.pow(2, 15), // 32KB
Math.pow(2, 29), // 512MB
Expand All @@ -204,8 +204,8 @@ describe('arr', function () {
});

it('needs to consume', function () {
function batchConstrained (batch) { return sum(batch) < batchMaxSize; }
const batchMaxSize = 3;
function batchConstrained (batch) { return sum(batch) < batchMaxSize; }
let sizes = [1, 4, 2, 3];
expect(() => batchify(sizes, batchConstrained))
.throws(/does not ensure consumption of at least one/);
Expand Down
2 changes: 1 addition & 1 deletion lively.lang/tests/function-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('fun', function () {

it('can extract a function body a string', function () {
let f = function (arg1, arg2, arg4) { let x = { n: 33 }; return x.n + arg2 + arg4; };
expect(fun.extractBody(f)).to.equal('let x = { n: 33 };\nreturn x.n + arg2 + arg4;');
expect(fun.extractBody(f)).to.equal('let x = {\n n: 33\n};\nreturn x.n + arg2 + arg4;');
expect(fun.extractBody(function () {})).to.equal('');
expect(fun.extractBody(function () { 123; })).to.equal('123;');
});
Expand Down
6 changes: 3 additions & 3 deletions lively.vm/tests/esm-eval-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ describe('eval', () => {
if (modules) {
S = modules.getSystem('test', { baseURL: dir });
S.babelOptions = System.babelOptions;
S.set('lively.transpiler', System.get('lively.transpiler'));
S.config({ transpiler: 'lively.transpiler' });
S.translate = async (load) => await System.translate.bind(S)(load);
S.set('lively.transpiler.babel', System.get('lively.transpiler.babel'));
S.config({ transpiler: 'lively.transpiler.babel' });
S.translate = async (load, opts) => await System.translate.bind(S)(load, opts);
}

return S.import(module1);
Expand Down

0 comments on commit 072dd85

Please sign in to comment.