Skip to content

react: example: Check all dependents to avoid partial write #203

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

Merged
merged 2 commits into from
Sep 17, 2016
Merged

react: example: Check all dependents to avoid partial write #203

merged 2 commits into from
Sep 17, 2016

Conversation

petertseng
Copy link
Member

Fixes #202

@petertseng
Copy link
Member Author

I could write a test to deal with this, but this is quite an implementation detail. I will add the test and see what reviewers think.

@petertseng
Copy link
Member Author

petertseng commented Sep 14, 2016

Test added. Example solution fails the attached test unless it has the attached code change.

failures:

---- do_not_break_cell_if_creating_compute_cell_with_valid_and_invalid_input stdout ----
    thread 'do_not_break_cell_if_creating_compute_cell_with_valid_and_invalid_input' panicked at 'Cell to update disappeared while querying', src/lib.rs:119
note: Run with `RUST_BACKTRACE=1` for a backtrace.


failures:
    do_not_break_cell_if_creating_compute_cell_with_valid_and_invalid_input

It's not guaranteed that this will catch every single implementation that incorrectly does partial writes, but it's the best I can do, I think.

In case you wonder, this test doesn't seem necesary to add to exercism/problem-specifications#358 because most other tracks don't have to deal with cell IDs like we do; they can just have the cells reference each other (we didn't do that in Rust because mutual references are tricky).

@petertseng petertseng merged commit d6e8c86 into exercism:master Sep 17, 2016
@petertseng petertseng deleted the react branch September 17, 2016 18:45
@petertseng petertseng mentioned this pull request Oct 21, 2016
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants