mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-05-19 09:51:13 -04:00
test: add more comments, add additional test
This commit is contained in:
parent
3ef61e2248
commit
c90e033148
1 changed files with 4 additions and 1 deletions
|
@ -54,9 +54,12 @@ test('switch costume block runs correctly', t => {
|
|||
// Non-existant costumes do nothing
|
||||
t.strictEqual(testCostume(['a', 'b', 'c', 'd'], 'e', 3), 3);
|
||||
|
||||
// Difference between string and numeric arguments
|
||||
// Numeric arguments are always the costume index
|
||||
// String arguments are treated as costume names, and coerced to
|
||||
// a costume index as a fallback
|
||||
t.strictEqual(testCostume(['a', 'b', 'c', '2'], 2), 2);
|
||||
t.strictEqual(testCostume(['a', 'b', 'c', '2'], '2'), 4);
|
||||
t.strictEqual(testCostume(['a', 'b', 'c'], '2'), 2);
|
||||
|
||||
// 'previous costume' and 'next costume' increment/decrement
|
||||
t.strictEqual(testCostume(['a', 'b', 'c', 'd'], 'previous costume', 3), 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue