Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Allow garbage collection in property tests #32

Merged
merged 5 commits into from
Jan 6, 2018
Merged

Allow garbage collection in property tests #32

merged 5 commits into from
Jan 6, 2018

Conversation

Theodus
Copy link
Contributor

@Theodus Theodus commented Dec 30, 2017

This resolves #31 by performing property tests on generated samples and shrinking in separate, recursive actor behaviors. API changes are that ForAll requires a Generator val as an argument and the Property1UnitTest class has been added to implement the UnitTest trait. Examples in the documentation and the examples directory have been updated.

Copy link
Contributor

@mfelsche mfelsche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really really like this PR! There is just one tiny thing.

complete()
return
end
(var sample, _shrinker) = _prop1.gen().generate_and_shrink(_rnd)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the gen() method should only be called once to create the constructor. I'd suggest doing it in the constructor and assign it to a field.

fun ref fail() =>
_h.complete(false)

class _EmptyIterator[T]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this as part of itertools in the pony stdlib :)

@mfelsche
Copy link
Contributor

mfelsche commented Jan 6, 2018

Yeah! And thanks for silently fixing all the accidents in the codebase.

@mfelsche mfelsche merged commit eb59c8b into master Jan 6, 2018
mfelsche added a commit that referenced this pull request Jan 6, 2018
Theodus pushed a commit that referenced this pull request Jan 6, 2018
Properties do not need to import everything property.pony needed because of this ponyc bug: ponylang/ponyc#2150 anymore, due to the great work on #32
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 this pull request may close these issues.

Property tests don't get garbage collected
2 participants