Skip to content

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

Merged
petertseng merged 2 commits intoexercism:masterfrom
petertseng:react
Sep 17, 2016
Merged

react: example: Check all dependents to avoid partial write#203
petertseng merged 2 commits intoexercism:masterfrom
petertseng:react

Conversation

@petertseng
Copy link
Copy Markdown
Member

Fixes #202

@petertseng
Copy link
Copy Markdown
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
Copy Markdown
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