Intention Testing

I have created an Intention that creates a new root node with content based on the selected node (e.g. same name).

So far I've been struggling to come up with a way to create a test for this functionality in MPS:

The tutorial recommends using editor testcases for testing intentions but there seems to be no way how I can assert that the new root node was created or to check its content.

So what would be the correct approach here?

1 comment

You may try to label a node in your expected test output e.g. as "myNode" and then using that annotation you can inspect the output model:

read action with myNode.model/.getRepository() { 
  nlist<> r = myNode.model.roots(<all>); 
  assert r.size == r.contains...; 


Please sign in to leave a comment.