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

Update tests #4

Merged
merged 17 commits into from
Jan 19, 2020
Merged

Update tests #4

merged 17 commits into from
Jan 19, 2020

Conversation

mrsndmn
Copy link
Contributor

@mrsndmn mrsndmn commented Jan 15, 2020

I've refactored tests with testify. Seems it looks nice now.

Unfortunately, I cant do anything with benchmarks. There is no support of benchmarks in testify/suite.

@@ -0,0 +1,12 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alldroll
Copy link
Owner

@mrsndmn Thank you for your PR! I will review it tomorrow.

It looks promising.

@alldroll alldroll self-requested a review January 16, 2020 20:55
Copy link
Owner

@alldroll alldroll 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 your work! Please take a look at my review and we will be ready to merge it!

cdb_test.go Outdated
if reader.Size() != 7 {
t.Errorf("Expected size %d, got %d", 7, reader.Size())
// generate test records
const testRecordsCount = 10
Copy link
Owner

Choose a reason for hiding this comment

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

Do we need this const here? I guess we can remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fidex

cdb_test.go Outdated
{"key7", "value7"},
}
writer := suite.getCDBWriter()
defer writer.Close()
Copy link
Owner

Choose a reason for hiding this comment

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

We should check the result of Close function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! Thank you!

cdb_test.go Outdated
defer os.Remove("test.cdb")
func (suite *CDBTestSuite) TestShouldReturnNilOnNonExistingKeys() {
writer := suite.getCDBWriter()
writer.Close()
Copy link
Owner

Choose a reason for hiding this comment

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

Please add here check suite.Nilf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor Author

@mrsndmn mrsndmn 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 review! Fixed.

cdb_test.go Outdated
if reader.Size() != 7 {
t.Errorf("Expected size %d, got %d", 7, reader.Size())
// generate test records
const testRecordsCount = 10
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fidex

cdb_test.go Outdated
{"key7", "value7"},
}
writer := suite.getCDBWriter()
defer writer.Close()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! Thank you!

cdb_test.go Outdated
defer os.Remove("test.cdb")
func (suite *CDBTestSuite) TestShouldReturnNilOnNonExistingKeys() {
writer := suite.getCDBWriter()
writer.Close()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@mrsndmn
Copy link
Contributor Author

mrsndmn commented Jan 19, 2020

I also added testify/suite for iterator_test.go in separate branch. Can I merge it to this branch to review changes in this PR or it would be better to create another one?

@alldroll
Copy link
Owner

I also added testify/suite for iterator_test.go in separate branch. Can I merge it to this branch to review changes in this PR or it would be better to create another one?

It is better to create a separate PR:) Thank you for your work!

@alldroll alldroll merged commit f5a2644 into alldroll:master Jan 19, 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