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

Added Suspendable Open Calls #69

Merged

Conversation

blackmo18
Copy link
Contributor

@blackmo18 blackmo18 commented Nov 2, 2020

#66 Added Suspendable Open Calls

  • updated README.md
  • added equivalent suspend aware open csv calls
  • added respectively suspend open call tests

@codecov
Copy link

codecov bot commented Nov 2, 2020

Codecov Report

Merging #69 into master will increase coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #69      +/-   ##
============================================
+ Coverage     95.76%   95.88%   +0.12%     
  Complexity      151      151              
============================================
  Files            21       21              
  Lines           897      924      +27     
  Branches         68       68              
============================================
+ Hits            859      886      +27     
  Misses           15       15              
  Partials         23       23              
Impacted Files Coverage Δ Complexity Δ
...thub/doyaaaaaken/kotlincsv/client/CsvReaderTest.kt 97.42% <100.00%> (+0.41%) 1.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1fe2c8...9369a15. Read the comment docs.

- updated README.md
- added equivalent suspend aware open csv calls
- added respectively suspend open call tests
@blackmo18 blackmo18 force-pushed the enhancement/read-in-suspending-function branch from 4640d1f to 8601d8f Compare November 2, 2020 05:43
Copy link
Collaborator

@doyaaaaaken doyaaaaaken left a comment

Choose a reason for hiding this comment

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

Thank you for everything.
I commented about a few points.

*
* Usage example:
* <pre>
* val data: Sequence<List<String?>> = csvReader().open("test.csv") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

open -> openAsync

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied Changest at 9369a15

@@ -253,6 +255,44 @@ class CsvReaderTest : WordSpec() {
}
rows shouldBe listOf(listOf("a", "b", "c"), listOf("d", "e", "f"))
}
"execute as suspending function" should {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be better to use suspend fun inside openAsync method because these tests are for that use-case.

A suspend fun sample is written on Issue #66 (comment) . (processRow method)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I agree, but for the reason for test consistency of validating rows, I chose to use the kotlin asnyc flow.

The collect is a supending function, which i think cover the scenario we need.

@doyaaaaaken doyaaaaaken merged commit 15e0ea3 into jsoizo:master Nov 4, 2020
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