-
Notifications
You must be signed in to change notification settings - Fork 14
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
Increase formula coverage. #388
Conversation
JaCoCo Code Coverage 95.93% ✅
Generated by 🚫 Danger |
43418d7
to
5b0cc7b
Compare
|
||
private var removeListInvalidated: Boolean = false | ||
private var scheduledForRemoval: MutableList<DeferredAction<*>>? = null | ||
private var recomputeCheckToStartList: Boolean = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming these variables to have more descriptive names
} | ||
scheduledToStart?.addAll(actionList) | ||
for (action in actionList) { | ||
if (!isRunning(action)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic was poorly written as we were potentially adding to the list twice and checking isRunning()
multiple times.
5b0cc7b
to
905561b
Compare
905561b
to
4c59783
Compare
@@ -11,11 +11,11 @@ class DeferredAction<Event>( | |||
) { | |||
private var cancelable: Cancelable? = null | |||
|
|||
internal var listener: (Event) -> Unit = initial | |||
internal var listener: ((Event) -> Unit)? = initial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of setting empty lambda when disabling this, I made it nullable and set it to null.
cd86b15
to
e912f72
Compare
observer.input(false) | ||
observer.input(true) | ||
observer.input(false) | ||
observer.output { assertThat(this).isEqualTo(0) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the output value be equal to 2?
true - state (0) + 1
false - state = 1
true - state (1) + 1
false - state = 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, this is why the test name + comment are describing the situation
// TODO: I'm not sure if this is the right behavior
@Test
fun `action termination events are ignored`()
No description provided.