Skip to content

Conversation

@mariiatuzovska
Copy link
Contributor

No description provided.

mariiatuzovska and others added 2 commits December 6, 2024 14:23
Co-authored-by: Amanj Sherwany <sherwany.amanj@gmail.com>
@amanjpro
Copy link
Contributor

amanjpro commented Dec 6, 2024

You should cleanup the TempDir, that you have created after the test has run

csvReader := csv.NewReader(f)
records, err := csvReader.ReadAll()
require.NoError(t, err, "must read csv data")
require.Len(t, records, 800, "must contain 100 emails")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
require.Len(t, records, 800, "must contain 100 emails")
require.Len(t, records, 800, "must contain 800 emails")


"github.com/stretchr/testify/require"
)

Copy link
Contributor

Choose a reason for hiding this comment

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

const (
commonStart int 100
commonEnd int 900
nEmails int 1001
)

Copy link
Contributor

Choose a reason for hiding this comment

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

please use some constants instead

Comment on lines +68 to +69
_, exists := expectContain[line[0]]
require.True(t, exists, "must exist in the hash-encrypted list")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
_, exists := expectContain[line[0]]
require.True(t, exists, "must exist in the hash-encrypted list")
_, exists := expectContain[line[0]]
require.True(t, exists, "must exist in the hash-encrypted list")
delete(expectContain, line[0])

Copy link
Contributor

Choose a reason for hiding this comment

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

You don't want the same ID matching over and over again.

Comment on lines +132 to +133
_, exists := expectContain[line[0]]
require.True(t, exists, "must exist in the hash-encrypted list")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
_, exists := expectContain[line[0]]
require.True(t, exists, "must exist in the hash-encrypted list")
_, exists := expectContain[line[0]]
require.True(t, exists, "must exist in the hash-encrypted list")
delete(expectContain, line[0])

@mariiatuzovska mariiatuzovska merged commit 40e8d24 into main Dec 9, 2024
3 checks passed
@mariiatuzovska mariiatuzovska deleted the match-test branch December 9, 2024 17:49
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.

4 participants