-
Notifications
You must be signed in to change notification settings - Fork 24
STREAMS-1982: Add singleton compat for MinKey #23
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c1a582c
STREAMS-1982: Add singleton compat for MinKey
tcannon91 1c01dab
add zed editor to gitignore
tcannon91 b9e5a85
remove zed from gitignore
tcannon91 df43365
Add test serializing as bson
tcannon91 fb055b8
Remove assertion message
tcannon91 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 hidden or 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 |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| .lock-wscript | ||
| .idea/ | ||
| .vscode/ | ||
| .zed/ | ||
| *.iml | ||
| .npmrc | ||
| .nvmrc | ||
|
|
||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -87,7 +87,7 @@ const tsFromStr = Timestamp.fromString('ff', 16); | |
| assert.strictEqual(tsFromStr.i, 255); | ||
| assert.strictEqual(tsFromStr.t, 0); | ||
| assert.strictEqual(Timestamp.MAX_VALUE._bsontype, 'Long'); | ||
| assert.strictEqual(Timestamp.MAX_VALUE, Long.MAX_UNSIGNED_VALUE); | ||
| assert.strictEqual(Timestamp.MAX_VALUE, Long.MAX_UNSIGNED_VALUE); | ||
|
|
||
| const id = ObjectId('68ffa28b77bba38c9ddcf376'); | ||
| const dbRef = DBRef('testColl', id, 'testDb'); | ||
|
|
@@ -161,3 +161,15 @@ assert(sortedArrayJson.indexOf('"a"') < sortedArrayJson.indexOf('"z"'), 'Array.t | |
| assert(sortedArrayJson.indexOf('"b"') < sortedArrayJson.indexOf('"y"'), 'Array.tojson with sortedKeys=true should sort object keys in array elements'); | ||
| assert(unsortedArrayJson.indexOf('"z"') < unsortedArrayJson.indexOf('"a"'), 'Array.tojson with sortedKeys=false should not sort keys'); | ||
| assert(defaultArrayJson.indexOf('"z"') < defaultArrayJson.indexOf('"a"'), 'Array.tojson without sortedKeys should not sort keys'); | ||
|
|
||
| // Test MinKey | ||
| const minKey = new MinKey(); | ||
| assert(minKey instanceof MinKey, "minKey should be an instance of MinKey"); | ||
| assert.strictEqual(minKey.tojson(), '{ "$minKey" : 1 }', "minKey should serialize correctly"); | ||
| assert.strictEqual(minKey.toString(), "[object Function]", "minKey toString should work"); | ||
| assert.strictEqual(minKey.toJSON(), '{ "$minKey" : 1 }', "minKey toJSON should work"); | ||
|
||
|
|
||
| // Test that multiple references return the same instance | ||
| const anotherMinKeyRef = new MinKey(); | ||
| assert.strictEqual(minKey, anotherMinKeyRef, "minKey should be a singleton - v1"); | ||
| assert.strictEqual(MinKey(), MinKey(), "minKey should be a singleton - v2"); | ||
tcannon91 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.