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

Ensure that two chunks can be compared for equality and hash code #1159 #1163

Merged
merged 6 commits into from
Jul 11, 2019
Merged

Ensure that two chunks can be compared for equality and hash code #1159 #1163

merged 6 commits into from
Jul 11, 2019

Conversation

Vilkina
Copy link
Contributor

@Vilkina Vilkina commented Jul 11, 2019

No description provided.

@jdegoes
Copy link
Member

jdegoes commented Jul 11, 2019

@Vilkina Looks superb!

Just one small change: in order to run the tests, they must be in the specification, which is a string at the beginning of a class (this is because we use Specs2 for running tests, and this is the format it requires).

So at the beginning of ChunkSpec.scala, you can see:

def is: SpecStructure =
    "ChunkSpec".title ^
      s2"""
  chunk apply $apply
  chunk length $length
  chunk equality prop $equality
  chunk inequality $inequality
  flatMap chunk $flatMap
  map chunk $map
  materialize chunk $materialize
  foldLeft chunk $foldLeft
  filter chunk $filter
  drop chunk $drop
  take chunk $take
  dropWhile chunk $dropWhile
  takeWhile chunk $takeWhile
  toArray $toArray
  foreach $foreach
  concat chunk $concat
  An Array-based chunk that is filtered empty and mapped must not throw NPEs. $nullArrayBug
  toArray on concat of a slice must work properly. $toArrayOnConcatOfSlice
  toArray on concat of empty and integers must work properly. $toArrayOnConcatOfEmptyAndInts
  Chunk.filter that results in an empty Chunk must use Chunk.empty $filterConstFalseResultsInEmptyChunk
    """

You can add a line in the "spec string" for each test, something like:

Chunk reflexivity $testReflexivity
...

etc. Then run testOnly *ChunkSpec* from sbt, to confirm the tests are being run.

Then we'll be ready to merge!

@Vilkina
Copy link
Contributor Author

Vilkina commented Jul 11, 2019

Screen Shot 2019-07-11 at 4 52 33 PM

@jdegoes jdegoes merged commit 9dc6498 into zio:master Jul 11, 2019
@jdegoes
Copy link
Member

jdegoes commented Jul 11, 2019

@Vilkina Thank you for the contribution! 🎉

giphy

@Vilkina
Copy link
Contributor Author

Vilkina commented Jul 11, 2019

@jdegoes, looking forward for next ticket)

@jdegoes
Copy link
Member

jdegoes commented Jul 11, 2019

@Vilkina How about this one? 😉

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.

None yet

2 participants