Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marble diagram tests just don't work for synchronous scenarios #304

Closed
benlesh opened this issue Sep 13, 2015 · 7 comments · Fixed by #307
Closed

Marble diagram tests just don't work for synchronous scenarios #304

benlesh opened this issue Sep 13, 2015 · 7 comments · Fixed by #307

Comments

@benlesh
Copy link
Member

benlesh commented Sep 13, 2015

For example: Observable.of(1,2,3) ... how are you going to represent 3 values and a completion in 1 frame? 123|? and then how does that "line up" to expected results? What about 3 values and an error? what about 100ms, then 14 synchronous values, then 200ms then one value and it completes?

It's a shame because I find the look of the test DSL very compelling.

@mattpodwysocki can say "I told you so". :p

cc/@staltz and @trxcllnt

@staltz
Copy link
Member

staltz commented Sep 13, 2015

Why do you even need a marble diagram for purely synchronous cases? I think the DSL should be used only where convenient.

@headinthebox
Copy link

And since it is just a string, you can invent new notation for the sync case, like [1,2,3] or 1#2#3.

@benlesh
Copy link
Member Author

benlesh commented Sep 13, 2015

Why do you even need a marble diagram for purely synchronous cases? I think the DSL should be used only where convenient.

Imagine last, observable runs for some amount of time, then when it completes, it synchronously nexts, then completes in the same frame. That's not ------a| by our notation.

I've been thinking of something like @headinthebox was saying, but it messes with the ability to line them up.

e3.withLatestFrom(e1,e2)


e1 -a---|
e2 ---b-----|
e3 ------c---d----|
r  ------[cab]----|

// What about `[dab]`? 

I suppose the upside is, since they're tests you can specify that this shouldn't happen, but it worries me that I'll run into something else I haven't considered

@staltz
Copy link
Member

staltz commented Sep 13, 2015

Then just define e3 differently:

e3.withLatestFrom(e1,e2)

e1 -a---|
e2 ---b-----|
e3 ------c-----d-----|
r  ------[cab]-[dab]-|

@benlesh
Copy link
Member Author

benlesh commented Sep 13, 2015

Right. That's what I was saying. I'm just worried that there's something else I'm missing

@staltz
Copy link
Member

staltz commented Sep 13, 2015

Completely irrelevant to this thread, but since we're at it, for purely aesthetic purposes I prefer parentheses:

r ----(cab)--|

@benlesh
Copy link
Member Author

benlesh commented Sep 13, 2015

I like that, it doesn't visually match the pipe as much

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants