Initial commit of 001code-html Scratch frontend project.
Includes scratch-gui, scratch-vm, scratch-blocks, scratch-render, scratch-l10n, and deployment config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
32
scratch-vm/test/unit/blocks_pen_tw.js
Normal file
32
scratch-vm/test/unit/blocks_pen_tw.js
Normal file
@@ -0,0 +1,32 @@
|
||||
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();
|
||||
});
|
||||
Reference in New Issue
Block a user