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

Test and document native order #157

Merged
merged 3 commits into from
Dec 27, 2018
Merged

Test and document native order #157

merged 3 commits into from
Dec 27, 2018

Conversation

vweevers
Copy link
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
```js
const db = levelup(leveljs('time-db'))

db.createReadStream({ gt: new Date('2019-01-01') })
Copy link
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!

```js
const db = levelup(leveljs('books-db'))

await db.put(['Roald Dahl', 'Charlie and the Chocolate Factory'], {})
Copy link
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
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
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 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