Spaces:
Build error
Build error
File size: 1,009 Bytes
30c32c8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
const test = require('tap').test;
const Runtime = require('../../src/engine/runtime');
const Scratch3PenBlocks = require('../../src/extensions/scratch3_pen/index');
test('_clampPenSize', t => {
const rt = new Runtime();
const pen = new Scratch3PenBlocks(rt);
t.equal(pen._clampPenSize(-1), 1);
t.equal(pen._clampPenSize(0), 1);
t.equal(pen._clampPenSize(0.25), 1);
t.equal(pen._clampPenSize(1), 1);
t.equal(pen._clampPenSize(10), 10);
t.equal(pen._clampPenSize(1000), 1000);
t.equal(pen._clampPenSize(1200), 1200);
t.equal(pen._clampPenSize(1201), 1200);
rt.setRuntimeOptions({
miscLimits: false
});
t.equal(pen._clampPenSize(-1), 0);
t.equal(pen._clampPenSize(0), 0);
t.equal(pen._clampPenSize(0.25), 0.25);
t.equal(pen._clampPenSize(1), 1);
t.equal(pen._clampPenSize(10), 10);
t.equal(pen._clampPenSize(1000), 1000);
t.equal(pen._clampPenSize(1200), 1200);
t.equal(pen._clampPenSize(1201), 1201);
t.end();
});
|