Pull AssertSnapshotEquals from YSA into mpsutils
This assertion for strings keeps the expected text in a property and provides a merge view to update it with the actual assertion value.
Motivation
Tests that aim to make changes on long texts inertial and conscious. A typical use case is serialization.
Example Scenario
Given I run such assertion in my local MPS
And the snapshot differs from the actual value
When I open the assertion and hit F4 to refresh the editor
Then I see a link "Update Snapshot" appeared
When I click that link
Then I see a merge view
And the left hand side shows the expected snapshot that is stored in the assertion
And the right hand side shows the actual value which the expression has returned on the last test run
Given I merge all differences into the middle
When I save the merge
Then the snapshot got updated
When rerun the test
Then the test will be green
For more details, see this video
Todos
- consider if memory consumption of this is an issue
- [ ] consider refreshing the assertions editors when remembering unequalities
AssertSnapshotEqualsStorageto avoid confusion when forgetting the F5 - [ ] remove
updateOnNextRunif still unused - [ ] move it from YSA to mpsutils (it consists of the
AssertSnapshotEqualswith its aspects, the runtime classAssertSnapshotEqualsStorage, and the test for the assertionAssertSnapshotEqualsStorage_Test) - [ ] possibly fix behavior of new created
assert snapshot equalswith empty snapshot
(as a sidenote: the code there is still on feature/threaten-channels and awaiting to be merged to master)
in between, the code at the YSA-side has been merged to master.
@kbirken Any thoughts on whether the infrastructure-team can help me out here? (And to what extent?)