Skip to content

feat(test): add unit tests for Zip operator#121

Closed
intojhanurag wants to merge 8 commits intosamber:mainfrom
intojhanurag:feature/zip-file-test
Closed

feat(test): add unit tests for Zip operator#121
intojhanurag wants to merge 8 commits intosamber:mainfrom
intojhanurag:feature/zip-file-test

Conversation

@intojhanurag
Copy link
Copy Markdown

@intojhanurag intojhanurag commented Oct 16, 2025

Hey @samber, could you please check if I'm adding the right test?
I just want to make sure it's correct before proceeding with the rest of the Zip-related tests.

@intojhanurag intojhanurag changed the title zip1 test added zip/test added Oct 16, 2025
@intojhanurag intojhanurag changed the title zip/test added eat(test): add unit tests for Zip operator Oct 16, 2025
@intojhanurag intojhanurag changed the title eat(test): add unit tests for Zip operator feat(test): add unit tests for Zip operator Oct 16, 2025
Copy link
Copy Markdown
Owner

@samber samber left a comment

Choose a reason for hiding this comment

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

It is a good start ;)

is.NoError(err)

is.Equal([]lo.Tuple2[int, string]{
{A: 1, B: "A"},
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Use lo.T2(...) instead

@@ -661,11 +661,92 @@ func TestOperatorCreationCombineLatestAny(t *testing.T) { //nolint:paralleltest
}

func TestOperatorCreationZip(t *testing.T) { //nolint:paralleltest
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
func TestOperatorCreationZip(t *testing.T) { //nolint:paralleltest
func TestOperatorCreationZip(t *testing.T) {
t.Parallel()

})
}

func TestOperatorCreationZip2(t *testing.T) { //nolint:paralleltest
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
func TestOperatorCreationZip2(t *testing.T) { //nolint:paralleltest
func TestOperatorCreationZip(t *testing.T) {
t.Parallel()

@intojhanurag
Copy link
Copy Markdown
Author

Hey @samber , It is ready for review . I did the required changes in all tests from zip1 to zip 6

@samber samber added operator Related to Operator logic or components (chainable transformation in reactive programming) core Changes affecting the core logic or main components of the project, in root/internal/testing pkg tests Related to unit tests, integration tests, or end-to-end tests. labels Oct 20, 2025
is.NoError(err)

is.Equal([][]any{
{1, "A", true},
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

lo.T3(...)

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.23%. Comparing base (96b598c) to head (8640795).
⚠️ Report is 42 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #121      +/-   ##
==========================================
+ Coverage   62.28%   69.23%   +6.94%     
==========================================
  Files          76       76              
  Lines        9485     9505      +20     
==========================================
+ Hits         5908     6581     +673     
+ Misses       3492     2839     -653     
  Partials       85       85              
Flag Coverage Δ
unittests 69.23% <ø> (+6.94%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@intojhanurag
Copy link
Copy Markdown
Author

Hey @samber ! You suggested to add tests for every other methods.
But I am confused. Does ‘every other method’ mean all the ones where // TODO is mentioned, except Zip, in the operator_creation_test.go file?

@samber
Copy link
Copy Markdown
Owner

samber commented Oct 21, 2025

I mean for every variant of Zip.

@intojhanurag
Copy link
Copy Markdown
Author

I mean for every variant of Zip.

Make sense , Like I have to add those extra two test cases in all Zip . Right ?

@intojhanurag
Copy link
Copy Markdown
Author

Hey @samber , I added the extra two edges cases in all Zip.

@samber
Copy link
Copy Markdown
Owner

samber commented Oct 22, 2025

You did not fix every comment, also, check the linter

@intojhanurag
Copy link
Copy Markdown
Author

Hey @samber , I fixed the linting issue , but I am not sure which comments are remaining . I removed all comments that was related to zip.

@samber
Copy link
Copy Markdown
Owner

samber commented Oct 25, 2025

i mean the comments in this thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes affecting the core logic or main components of the project, in root/internal/testing pkg operator Related to Operator logic or components (chainable transformation in reactive programming) tests Related to unit tests, integration tests, or end-to-end tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants