Commit graph

174 commits

Author SHA1 Message Date
Karishma Chadha
cd8de5f156 Add tests! =] 2019-02-04 19:05:44 -05:00
Karishma Chadha
df823a06f6 Add tests for project changed state. 2019-01-30 10:59:25 -05:00
Karishma Chadha
0fa5e9181a
Merge pull request #1839 from mzgoddard/fix-missing-no-param
fix: initialize stack frame params for all procedures
2019-01-16 14:06:38 -05:00
Karishma Chadha
85843e5d6f Fix cloud variable limit 2019-01-07 11:12:47 -05:00
Karishma Chadha
397711b822 Update sb1-converter and add an sb import integration test. 2018-12-21 14:22:33 -05:00
julescubtree
9aa23a31ee
add test file for loading draggability unit test 2018-12-17 09:44:14 -08:00
Karishma Chadha
dfd4735871
Merge pull request #1833 from kchadha/fix-sb2-from-sb1-import
Fix issue importing some sb2s that were originally sb1s, with baseLayerMd5 property formatted differently.
2018-12-13 15:59:44 -05:00
Michael "Z" Goddard
20ff75b776
fix: initialize stack frame params for all procedures
A previous change fixed compatibility with Scratch 2 removing 3's
unintentional scope leaking. This furthers that change so that
procedures with no parameters will also not accidentally use values in
other procedure stacks.
2018-12-13 10:51:44 -05:00
Karishma Chadha
6c51c40245
Merge pull request #1834 from kchadha/edge-hat-duplicate-sprite
Fix issue where edge-activated hats only run on one sprite after duplicating the sprite
2018-12-12 21:13:09 -05:00
Karishma Chadha
95dafb43c4 Serialize x and y for topLevel blocks even if one or both of the values is 0. 2018-12-12 18:51:36 -05:00
Karishma Chadha
19737d4e39 Fix issue where edge-activated hats only run on one sprite when sprite is duplicated or cloned. 2018-12-11 12:28:37 -05:00
Karishma Chadha
27be6f1677 Add integration test 2018-12-10 18:24:28 -05:00
picklesrus
ebe06a97d9
Merge pull request #1818 from picklesrus/monitor-vars-project-load
Clear out the blocks in dispose. Fixes #1758 where old monitored vari…
2018-12-07 15:08:09 -05:00
Paul Kaplan
4756726e43
Merge pull request #1816 from paulkaplan/do-save-tl-var-blocks
Add a test and fix for not serializing top-level variable reporters
2018-12-06 05:32:23 -05:00
picklesrus
694af40964 Fix the monitor threads test. It was written before monitors could be loaded so was hand editing the monitorBlocks before loading the default project. The code I added to dispose was then clearing that out. 2018-12-05 16:54:08 -05:00
picklesrus
cddcea652b Clear out the blocks in dispose. Fixes #1758 where old monitored variables were getting kept across project loads 2018-12-05 12:09:12 -05:00
Paul Kaplan
be65b615a2 Add a test and fix for not serializing top-level variable reporters 2018-12-05 11:35:22 -05:00
Katie Broida
ef8bbb7186 Set video state after project load event, adding extension for the first time 2018-12-05 11:08:00 -05:00
Karishma Chadha
d71b405300
Merge pull request #1740 from bocoup/fix-flacky-test
Fix flacky test: order-changes-backwards-2-broadcast-and-wait.sb2
2018-12-04 11:18:51 -05:00
Valerie R Young
ee40e411ab Only one say end after broadcaste and waits 2018-11-29 14:00:57 -05:00
Valerie R Young
d8078c018d Implement feedback, broadcast order 2018-11-16 17:24:28 -05:00
Valerie Young
2ca735eab4
Merge pull request #1716 from bocoup/unknown-block-input-fix
Handle unknown opcode in input
2018-11-15 10:09:46 -05:00
Karishma Chadha
3dd0d0a657
Merge pull request #1686 from kchadha/monitor-save-load
Monitor save & load
2018-11-14 13:23:10 -05:00
Karishma Chadha
6dfc0b678e Add integration test for monitor save/load. 2018-11-09 23:45:49 -05:00
Karishma Chadha
cfa71723eb Ignore video sensing monitor and import music tempo monitor unless it is hidden. Load extensions for visible monitors. Add tests for new functionality. 2018-11-09 00:09:54 -05:00
Karishma Chadha
87244b4110 Normalize capitalization of sensing_current block fields during sb2 import and during monitor id generation. Update monitors integration test to include sensing_current block monitors. 2018-11-08 14:11:30 -05:00
Karishma Chadha
8aa0fa11aa
Merge pull request #1649 from mzgoddard/get-attribute-stage-alt-name
Get attribute stage alt name
2018-11-07 17:47:44 -05:00
Karishma Chadha
4bb2d19584
Merge pull request #1683 from mzgoddard/sequencer-thread-cleanup
Sequencer thread cleanup
2018-11-07 17:15:11 -05:00
Valerie R Young
05a28e553e Say 'end' only after 4th increment 2018-11-06 13:26:25 -05:00
Valerie R Young
2c76d3bf71 Add unit test for unknown opcode inputs 2018-11-05 13:23:31 -05:00
Karishma Chadha
5593c9ab3e
Merge pull request #1711 from kchadha/import-cloud-var-info
Import cloud var info and enforce cloud var limit
2018-11-01 09:46:37 -04:00
Katie Broida
5cf10b1af1
Tests to check whether extensions load (#1700) 2018-10-31 17:22:21 -04:00
Karishma Chadha
a6de046dda Add unit and integration tests for the new functionality. 2018-10-30 18:54:25 -04:00
Karishma Chadha
d3e38c1ae9
Merge pull request #1640 from mzgoddard/set-procedure-param-missing
Set procedure param missing
2018-10-25 00:13:51 -04:00
Katie Broida
18c83dcc67
Prevent non-core extensions from adding monitors (#1688) 2018-10-24 16:43:01 -04:00
Michael "Z" Goddard
afd2ed72c8
add procedure parameter used outside of proc integrations 2018-10-23 15:14:31 -04:00
Michael "Z" Goddard
58a7a6bb04
add get param blocks in wrong procedure integrations 2018-10-23 15:14:30 -04:00
Michael "Z" Goddard
ef4045aaf1
Merge pull request #1642 from mzgoddard/set-procedure-param-defaults
Set procedure param defaults
2018-10-23 15:13:16 -04:00
Michael "Z" Goddard
c986d0cf23
test that broadcast_and_wait can yield and continue in the same tick 2018-10-19 16:37:33 -04:00
DD
91e2f3a935 Revert 1643 Confirm extension in use in sb2 serialization 2018-10-18 11:06:13 -04:00
Katie Broida
899ce56214
Confirm extension in use in sb2 serialization (#1643)
Add a check when serializing sb2 projects to see whether an extension is actually in use in a block or a visible monitor.
2018-10-17 10:49:08 -04:00
Michael "Z" Goddard
ca38fb2cc3
add recursive procedure default parameter execute integrations 2018-10-16 16:31:45 -04:00
Michael "Z" Goddard
42570293d6
add sensing getAttributeOf with Stage alternate name integration 2018-10-09 11:29:20 -04:00
Michael "Z" Goddard
533109541b
add broadcast and wait integration that ensures it yields a tick 2018-10-05 16:33:56 -04:00
Michael "Z" Goddard
f1af5b5e99
add order changing broadcast and wait with same message integration 2018-10-05 14:54:02 -04:00
Michael "Z" Goddard
afc546077e
add execution order execute integration tests
- rename order-clones-2 -> order-clones-static-2
2018-10-05 13:26:05 -04:00
Michael "Z" Goddard
dec0cd10df
add execution order execute integration tests 2018-10-03 10:35:24 -04:00
Andrew Sliwinski
7a28d5e41d
Merge pull request #1586 from mzgoddard/variable-id-type
conflict workaround for variables and lists of the same name
2018-10-01 18:27:59 -04:00
Michael "Z" Goddard
8c98000caf
add execute integration masked variable and list test 2018-09-27 11:57:24 -04:00
Chris Willis-Ford
c541e87da5
Merge pull request #1587 from cwillisf/util_token-bucket
Add a rate-limited task queue utility
2018-09-19 10:48:04 -07:00
Karishma Chadha
0ad59d3859
Merge pull request #1563 from mzgoddard/get-param-condition-input
Get param condition input
2018-09-18 15:29:43 -04:00
Christopher Willis-Ford
33e0197ad5 Add tests for TokenBucket 2018-09-13 17:05:00 -04:00
Michael "Z" Goddard
cbb79c40ad
add monitors-stage-name test
Test that an sb2 with a stage name other than Stage and a monitor on
one of its variables is able to load.
2018-09-11 15:10:14 -04:00
Michael "Z" Goddard
d8309e9d24
add execute integration procedures-boolean-reporter-bug test 2018-09-07 19:06:18 -04:00
Ray Schamp
9c556219ce
Merge pull request #1528 from kchadha/fix-comment-import
Fix Comment import/save/load issue
2018-08-28 16:04:53 -04:00
Karishma Chadha
2c24ef37a0 Fix issue where block comments converted to workspace comments import correctly when there are no scripts on the workspace. 2018-08-24 14:29:10 -04:00
Karishma Chadha
c65c06534e Add fixture and integration test for the project load failure that was resolved. 2018-08-23 18:56:22 -04:00
Karishma Chadha
50f65b4e60 Add test fixture and integration test. 2018-08-22 19:06:06 -04:00
Mx Corey Frang
c092fe9f83
Use proposed drawableTouching interface from render (#1419)
* use new drawableTouching interface from render

* Fix mock renderer for new API call

* with lint fix
2018-08-09 10:10:23 -04:00
Karishma Chadha
812e7a3772 Preserve sprite layer order information across saving and loading an sb3. 2018-07-24 11:00:48 -04:00
Karishma Chadha
2508dc46ca Order sprites in 2.0 projects based on the serailzied indexInLibrary property. Store original ordering (e.g. layer order of sprites on the stage) to use when installing targets. 2018-07-23 15:25:05 -04:00
Paul Kaplan
9f517bd483 Deal with comments attached to undefined blocks
Also fix an issue where you couldn't save/load projects that had multiple comments linked to a single block.
2018-06-26 16:41:10 -04:00
Paul Kaplan
e7e300caeb Skip unknown opcode blocks while parsing 2018-06-26 15:58:43 -04:00
Karishma Chadha
073bb37c30 Add a test for 'getAllVariableAndListReferences' function. 2018-06-20 10:32:36 -04:00
kchadha
da30abbfb5
Merge pull request #1240 from kchadha/block-comment-disappearing-bugfix
Add comment id to block when converting from XML to vm representation.
2018-06-15 17:36:48 -04:00
Karishma Chadha
f3d49f75c8 Clean up comment serialization, add tests for new and old serialization (old is still valid, just more verbose). 2018-06-15 14:57:49 -04:00
Karishma Chadha
76b423e481 Make sure to set comment property of block when creating a new block via XML using the adapter. Update unit tests. 2018-06-15 13:58:03 -04:00
Karishma Chadha
861d801d88 Add tests for comment save and load. 2018-06-14 16:58:03 -04:00
Karishma Chadha
240701d65a Add some tests for comments... 2018-06-12 18:29:43 -04:00
Karishma Chadha
537dc9bcd5 Addressing PR comments. 2018-05-31 16:33:42 -04:00
Karishma Chadha
e2ce047fa1 Test and lint fixes. 2018-05-16 16:00:50 -04:00
Paul Kaplan
e0db8529bf Add an sb2 import test for importing monitors.
Checks for
- monitor types set correctly (all 4)
- monitor visibility set correctly
- monitor threads not running if not visible
- monitor positioning imported
- monitor width/height for lists
- custom monitor slider range
- sprite specificity
2018-05-09 09:33:28 -04:00
Paul Kaplan
db646fd3c2 Remove monitors from sb2 fixtures that expect no threads to stay running 2018-05-09 08:44:03 -04:00
Karishma Chadha
55352e88b1 Tests and cleanup of addSprite3 so that .sprite3 format does not need to be nested inside an extra {targets: ...} 2018-05-04 11:00:45 -04:00
Michael "Z" Goddard
dbe548eb18
Move execute integration fixtures into test/fixtures 2018-05-02 15:54:54 -04:00
Paul Kaplan
f29482957c Change getSkinSize to getCurrentSkinSize for renderer update. 2018-04-10 09:50:18 -04:00
Karishma Chadha
b2a4f563a0 Pull JSON.parse into extractProjectJson function. 2018-04-05 13:58:45 -04:00
Karishma Chadha
6c2838e8f4 Renaming file reading/extracting functions in tests. 2018-04-05 13:46:07 -04:00
Karishma Chadha
af32f0772e Add integration test for offline sb2 project with custom assets not on the server. 2018-04-05 10:51:15 -04:00
Karishma Chadha
1511fa79e3 Update tests to allow parsing whole .sb2s 2018-03-25 19:08:52 -04:00
Paul Kaplan
140094a7ad Make "when clicked" blocks target dependent.
This involves adding a new opcode, event_whenstageclicked, and adding a
method to the blocks container to update the opcode pair depending on
whether the target is the stage. This method is then called in two
places: first after the sb2 import parses the blocks (not done in the
sb2 parsing itself because no other blocks are target specific) and then
again when blocks are shared between targets.

Also added tests for the block container method, and a fixture project
that tests the opcode splitting on sb2 import.
2018-03-20 10:41:50 -04:00
Christopher Willis-Ford
b5d7602f4f Add test for say/think and wait
This test currently fails due to a bug in the sequencer's `stepThread`
method. The bug affects real projects, too, but was not caught by any
test prior to this one.
2018-03-14 16:16:59 -07:00
Paul Kaplan
1e27d21b15
Merge pull request #782 from kchadha/list-typed-variable
List typed variable
2017-11-15 12:48:56 -05:00
Karishma Chadha
3f444138db Updating tests for refactoring lists. Updating demo fixture -- now we have IDs and variable types for variables. 2017-11-13 16:30:47 -05:00
Scimonster
7afb17df7f Correctly deserialize HTML entities in block DOM
E.g. in variable names
2017-10-09 01:19:55 +03:00
Chris Willis-Ford
2665ef2b2b Merge pull request #640 from cwillisf/feature/message-dispatch
Implement message dispatch system
2017-08-17 10:57:23 -07:00
Christopher Willis-Ford
b4c0cfe940 Refactor common code in {central,worker}-dispatch
Central dispatch and worker dispatch share most of their code now by
inheriting from a new shared dispatch class.

Also, the format of passed messages has been altered to make it easier
to understand in a debugger.
2017-08-09 17:30:00 -04:00
DD Liu
fed449876f just hat changes 2017-08-03 16:01:53 -04:00
Christopher Willis-Ford
84ac66d6e5 Fix exception message 2017-07-21 13:23:52 -07:00
Christopher Willis-Ford
0fcc248ac1 Add tests for message dispatch system; fix bugs
The tests run using TinyWorker, which emulates web workers on Node.
There are quite a few quirks in that situation due to the differences
between Node and Webpack as well as the differences between TinyWorker
and real Web Workers.

The tests also exposed a few bugs in the dispatch system, which have now
been fixed. Most notably, if a method called through the dispatch system
throws an exception that exception will now be passed back to the
caller. Previously the exception would escape the dispatch system and
the caller would never hear any response at all.
2017-07-21 13:23:52 -07:00
Paul Kaplan
bd3a29650b Fix variable import scoping 2017-07-17 12:28:44 -04:00
Christopher Willis-Ford
6275710e47 Add test case for pen state cloning 2017-06-16 16:29:12 -07:00
Christopher Willis-Ford
cd1c72c7cc Convert attachTestStorage to makeTestStorage
Rather than assuming that the storage instance will be attached to a VM,
just return it. Callers may attach it to a `VM` or (in the case of
`import_sb2.js`) to a `Runtime`.
2017-06-12 12:34:20 -07:00
Christopher Willis-Ford
6320fd72c3 Add test for clone cleanup
This new test verifies that clones and their associated threads are
cleaned up properly by the `delete this clone` block. The clones run two
stacks each: one which waits and then deletes the clone, and another
which includes a `forever` loop: this is to verify that the thread
running the `forever` loop is ended when the clone itself is deleted.
The project does this with two batches of clones to ensure there are no
problems with reusing array indices previously occupied by now-removed
threads or clones.
2017-06-08 11:16:29 -07:00
Christopher Willis-Ford
eb931fd99b Specify dataFormat when loading asset for import
When importing a project we know the file extension for each asset to be
loaded. This change provides that information to the storage system so
that we can load assets which don't use the default. For example, this
allows loading JPG-format backdrops.

In support of this change, there's a new function on `StringUtil` called
`splitFirst`, which splits a string on the first instance of a separator
character. This change includes unit tests for this new function.
2017-05-24 15:35:10 -07:00
Ray Schamp
baee9a2793 Don't clean costume and sound lists
They are already clean, since we don't store the data on them any more.
2017-05-04 13:03:42 -04:00
Ray Schamp
f785117e1d Lint and fix failing tests 2017-04-27 17:49:57 -04:00
Ray Schamp
bafdf8d9f2 Use ES6 linting rules in the project root
Update all tests for `no-var` and `prefer-arrow-callback` (using `--fix`)
2017-04-24 15:37:58 -04:00
Andrew Sliwinski
8dc94391b0 Merge pull request #527 from CSnap/add_testing
Added testing to rendered-target
2017-04-24 10:15:55 -04:00
SillyInventor
a158db8aff Implemented Proposed Fixes
Moved 'fake renderer' to fixtures
Fixed spacing after ()
Removed extra line break
2017-04-24 10:04:06 -04:00