Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Mock mismatch with semantics #368

Open
luntain opened this issue Jun 4, 2020 · 1 comment
Open

Mock mismatch with semantics #368

luntain opened this issue Jun 4, 2020 · 1 comment

Comments

@luntain
Copy link

luntain commented Jun 4, 2020

My system under test has an operation that returns a list of references, however, there is no way to precisely mock it using the model. I only know a constraint on the list of references the system can return. I get:

Continuing to execute commands at this point could result in scope
errors, because we might have commands that use references (returned
by mock) that are not available (returned by semantics), to avoid
this please fix the mismatch.

This is related to Issue 236. The mock and why it is needed is a mystery. This error message is hard to understand, because it is expressed in terms of the internals of the library. It feels that in order to understand it I would need to read the code of the lib.

@stevana
Copy link
Collaborator

stevana commented Jun 9, 2020

This error message is hard to understand, because it is expressed in terms of the internals of the library.

What internals? I don't see a single concept in that error message that isn't exposed to the user?

It feels that in order to understand it I would need to read the code of the lib.

Go ahead, the code is fairly simple. Afterwards perhaps you can suggest how the error message can be improved, because I can't think of a better way to put it...

mock is a hack, as I admit in the issue you linked to. I don't know how to remove mock while retaining the possibility to return different references though, also it turns out mock can be used in unexpected but useful ways: https://www.well-typed.com/blog/2019/01/qsm-in-depth/ .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants