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

memfs: bug fixing #26

Merged
merged 1 commit into from
Apr 19, 2017
Merged

Conversation

ajnavarro
Copy link
Contributor

In this PR we fix two different bugs in memfs implementation:

@codecov
Copy link

codecov bot commented Apr 18, 2017

Codecov Report

Merging #26 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #26      +/-   ##
==========================================
+ Coverage    90.2%   90.27%   +0.06%     
==========================================
  Files           6        6              
  Lines         429      432       +3     
==========================================
+ Hits          387      390       +3     
  Misses         23       23              
  Partials       19       19
Impacted Files Coverage Δ
memfs/memory.go 95.97% <100%> (ø) ⬆️
memfs/storage.go 92.72% <100%> (+0.2%) ⬆️

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 b383e4e...4b48e46. Read the comment docs.

@ajnavarro ajnavarro requested review from smola and mcuadros April 18, 2017 12:25
@ajnavarro ajnavarro force-pushed the fix/seek-file-position branch 2 times, most recently from f0b43b8 to 0db0771 Compare April 18, 2017 13:35
test/fs_suite.go Outdated
@@ -715,6 +715,57 @@ func (s *FilesystemSuite) TestReadAtOnReadOnly(c *C) {
c.Assert(f.Close(), IsNil)
}

func (s *FilesystemSuite) TestWriteAndRead(c *C) {
Copy link
Contributor

Choose a reason for hiding this comment

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

since you are testing two bugs, maybe you can create two tests

@ajnavarro ajnavarro force-pushed the fix/seek-file-position branch from 0db0771 to be99196 Compare April 18, 2017 14:28
In this PR we fix two different bugs in memfs implementation:

- Using ReadAt, if the provided slice of bytes has a size bigger than the data to read, it must return the result and a io.EOF error.
- ReadAt must not affect to the offset position: https://golang.org/src/io/io.go?s=7545:7620#L203
@ajnavarro ajnavarro force-pushed the fix/seek-file-position branch from be99196 to 4b48e46 Compare April 18, 2017 14:30
@mcuadros mcuadros merged commit 99d8398 into src-d:master Apr 19, 2017
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.

3 participants