-
Notifications
You must be signed in to change notification settings - Fork 895
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
GODRIVER-2976 Remove deprecated BSON code. #1698
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fd391ba
WIP
qingyang-hu 615c93d
WIP
qingyang-hu 6d76528
WIP
qingyang-hu 87a2c5a
WIP
qingyang-hu 97c53ce
Merge branch 'master' into godriver2976p4
qingyang-hu 4712598
updates
qingyang-hu 8974936
update tests
qingyang-hu f79e67d
fix racing
qingyang-hu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -455,7 +455,7 @@ func TestCopier(t *testing.T) { | |
noerr(t, err) | ||
_, _, err = vr.ReadElement() | ||
noerr(t, err) | ||
btype, got, err := CopyValueToBytes(vr) | ||
btype, got, err := copyValueToBytes(vr) | ||
noerr(t, err) | ||
want := bsoncore.AppendString(nil, "world") | ||
if btype != TypeString { | ||
|
@@ -467,7 +467,7 @@ func TestCopier(t *testing.T) { | |
}) | ||
t.Run("Non BytesReader", func(t *testing.T) { | ||
llvrw := &TestValueReaderWriter{t: t, bsontype: TypeString, readval: "Hello, world!"} | ||
btype, got, err := CopyValueToBytes(llvrw) | ||
btype, got, err := copyValueToBytes(llvrw) | ||
noerr(t, err) | ||
want := bsoncore.AppendString(nil, "Hello, world!") | ||
if btype != TypeString { | ||
|
@@ -478,51 +478,4 @@ func TestCopier(t *testing.T) { | |
} | ||
}) | ||
}) | ||
t.Run("AppendValueBytes", func(t *testing.T) { | ||
t.Run("BytesReader", func(t *testing.T) { | ||
var idx int32 | ||
b, err := bsoncore.AppendDocumentEnd( | ||
bsoncore.AppendStringElement( | ||
bsoncore.AppendDocumentStartInline(nil, &idx), | ||
"hello", "world", | ||
), | ||
idx, | ||
) | ||
noerr(t, err) | ||
vr := newValueReader(b) | ||
_, err = vr.ReadDocument() | ||
noerr(t, err) | ||
_, _, err = vr.ReadElement() | ||
noerr(t, err) | ||
btype, got, err := appendValueBytes(nil, vr) | ||
noerr(t, err) | ||
want := bsoncore.AppendString(nil, "world") | ||
if btype != TypeString { | ||
t.Errorf("Incorrect type returned. got %v; want %v", btype, TypeString) | ||
} | ||
if !bytes.Equal(got, want) { | ||
t.Errorf("Bytes do not match. got %v; want %v", got, want) | ||
} | ||
}) | ||
t.Run("Non BytesReader", func(t *testing.T) { | ||
llvrw := &TestValueReaderWriter{t: t, bsontype: TypeString, readval: "Hello, world!"} | ||
btype, got, err := appendValueBytes(nil, llvrw) | ||
noerr(t, err) | ||
want := bsoncore.AppendString(nil, "Hello, world!") | ||
if btype != TypeString { | ||
t.Errorf("Incorrect type returned. got %v; want %v", btype, TypeString) | ||
} | ||
if !bytes.Equal(got, want) { | ||
t.Errorf("Bytes do not match. got %v; want %v", got, want) | ||
} | ||
}) | ||
t.Run("CopyValue error", func(t *testing.T) { | ||
want := errors.New("CopyValue error") | ||
llvrw := &TestValueReaderWriter{t: t, bsontype: TypeString, err: want, errAfter: llvrwReadString} | ||
_, _, got := appendValueBytes(make([]byte, 0), llvrw) | ||
if !assert.CompareErrors(got, want) { | ||
t.Errorf("Errors do not match. got %v; want %v", got, want) | ||
} | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This subtest should be moved to |
||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code