Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

Test and document native order#157

Merged
vweevers merged 3 commits intomasterfrom
fixed-native-order
Dec 27, 2018
Merged

Test and document native order#157
vweevers merged 3 commits intomasterfrom
fixed-native-order

Conversation

@vweevers
Copy link
Copy Markdown
Member

Closes #156. Reverts the temporary workaround introduced in #155.

Tested locally in Chrome, FF, Opera, IE and Edge.

Stumbled upon a curious bug in IE and Edge: if the database contains any key types other than string, then { gte: '' } yields 0 results. I've disabled the relevant test by commenting it out.

@vweevers vweevers changed the title Test and document native order [wip] Test and document native order Dec 27, 2018
Comment thread README.md
```js
const db = levelup(leveljs('time-db'))

db.createReadStream({ gt: new Date('2019-01-01') })
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is really cool!

Comment thread README.md
```js
const db = levelup(leveljs('books-db'))

await db.put(['Roald Dahl', 'Charlie and the Chocolate Factory'], {})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also really cool! :)

@vweevers
Copy link
Copy Markdown
Member Author

Tests failed on what seems like an unrelated race issue (or conflict between tests, idk):

Click to expand
# add key after snapshotting that sorts first
ok 624 no open error
ok 625 no put error
ok 626 no put error
ok 627 no next error
ok 628 got a key
not ok 629 correct key
  ---
    operator: equal
    expected: 'z'
    actual:   'a'
    stack: |-
      Error: correct key
         at assert (http://airtap.local:37774/airtap/test-bundle.js:9389:9)
         at bound (http://airtap.local:37774/airtap/test-bundle.js:9241:21)
         at equal (http://airtap.local:37774/airtap/test-bundle.js:9549:5)
         at bound (http://airtap.local:37774/airtap/test-bundle.js:9241:21)
         at Anonymous function (http://airtap.local:37774/airtap/test-bundle.js:2255:9)
         at Anonymous function (http://airtap.local:37774/airtap/test-bundle.js:146:5)
         at Anonymous function (http://airtap.local:37774/airtap/test-bundle.js:27:788)
         at Item.prototype.run (http://airtap.local:37774/airtap/test-bundle.js:4476:5)
         at nextTick (http://airtap.local:37774/airtap/test-bundle.js:4447:7)
  ...
<MicrosoftEdge 18 on Windows 10> # add key after snapshotting that sorts first
Error: correct key
not ok 630 correct value
  ---
    operator: equal
    expected: 'from snapshot'
    actual:   'not from snapshot'
    stack: |-
      Error: correct value
         at assert (http://airtap.local:37774/airtap/test-bundle.js:9389:9)
         at bound (http://airtap.local:37774/airtap/test-bundle.js:9241:21)
         at equal (http://airtap.local:37774/airtap/test-bundle.js:9549:5)
         at bound (http://airtap.local:37774/airtap/test-bundle.js:9241:21)
         at Anonymous function (http://airtap.local:37774/airtap/test-bundle.js:2256:9)
         at Anonymous function (http://airtap.local:37774/airtap/test-bundle.js:146:5)
         at Anonymous function (http://airtap.local:37774/airtap/test-bundle.js:27:788)
         at Item.prototype.run (http://airtap.local:37774/airtap/test-bundle.js:4476:5)
         at nextTick (http://airtap.local:37774/airtap/test-bundle.js:4447:7)
  ...
<MicrosoftEdge 18 on Windows 10> # add key after snapshotting that sorts first
Error: correct value
ok 631 no run error
ok 632 no iterator end error

@vweevers
Copy link
Copy Markdown
Member Author

Restarted the build.

@vweevers vweevers merged commit 4e1f3ac into master Dec 27, 2018
@vweevers vweevers deleted the fixed-native-order branch December 27, 2018 13:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants