David Glasser
de9bb4bfc4
Change how we sanity-check _publishNewResults
...
The old version was just checking that docs *matched*, but we want the
stronger result that docs are *published*.
2014-02-26 15:53:48 -08:00
Slava Kim
a94bb6d883
Allow appending to buffer if new doc is equivalent to the greatest element
2014-02-25 23:26:29 -08:00
Slava Kim
2f4dac064e
Keep _id in published and buffer
2014-02-25 23:22:59 -08:00
Slava Kim
a0cc339b6d
toPublish and toBuffer (or staysInBuffer) can't be true at once
2014-02-25 23:19:20 -08:00
Slava Kim
afc58bcac6
fix typo
2014-02-25 23:15:02 -08:00
Slava Kim
4b955b5afc
Relax events order in tests as mongo-livedata doesn't define the order in observe interface
2014-02-25 22:45:29 -08:00
Slava Kim
b23a26fbbd
More white-box style tests for _safeAppendToBuffer flag
2014-02-25 11:49:54 -08:00
Slava Kim
370ee125a9
Rationalize the test failure
2014-02-25 11:37:01 -08:00
Slava Kim
76ffc74e0e
Tests tests tests
2014-02-25 11:26:38 -08:00
Slava Kim
6ad69c52ae
Explicit test for unsupported cursor with a single skip
2014-02-25 11:25:19 -08:00
Slava Kim
3355ba7e85
Fix a check when buffer can be null
2014-02-25 11:25:19 -08:00
Slava Kim
b082f1847a
Another small test missing
2014-02-25 10:00:27 -08:00
Slava Kim
be7038e1e8
More white-box tests
...
one test fails so far
2014-02-25 01:11:35 -08:00
Slava Kim
4657f8c1df
Use binary-heap package in mongo-livedata
2014-02-25 00:51:00 -08:00
Slava Kim
db28492e6b
Tweak the description of id-map
2014-02-25 00:45:22 -08:00
Slava Kim
b8c8d87d5f
Relax tests and remove a dead piece of code
...
Apparently the implementation of sin/cos changed in the recent Chrome as now the
results are off by 1e-6 (compared to a different C++ implementation we generated
the tests previously).
It is not worth tracking down the 1e-6 error and change implementation for it.
2014-02-25 00:28:23 -08:00
Slava Kim
aab7e3e794
Merge branch 'binary-heap' into oplog-limits-buffered
2014-02-25 00:19:17 -08:00
Slava Kim
7bd160192c
Replace ad-hoc inheritance with Meteor._inherit calls
2014-02-24 23:58:31 -08:00
Slava Kim
a51bc65372
Meteor._inherits - prototypical inheritance implementation
2014-02-24 23:58:25 -08:00
Slava Kim
6dfd5bfc29
Additional generated tests for min-max-heap
2014-02-24 21:25:17 -08:00
Slava Kim
9451416f27
Use options object in MaxHeap constructor and allow passing a custom IdMap class
2014-02-24 20:29:39 -08:00
Slava Kim
97f7ccfa63
Glasser's comments
2014-02-24 20:22:24 -08:00
Slava Kim
036dc4885e
Tiny changes to tests formatting
2014-02-24 00:26:11 -08:00
Slava Kim
90a0c2d5c2
Add missing _safeAppendToBuffer = false and add clarity with comments
2014-02-24 00:25:38 -08:00
Slava Kim
7c202f6004
Better assertions in the oplog code
2014-02-23 20:03:38 -08:00
Slava Kim
90ba50acb7
Restructure and comment on _handleDoc logic for limits
...
Logic remains the same.
2014-02-23 18:19:57 -08:00
Slava Kim
f0d13f6678
Restructure and update comments for _addMatching-limits behavior
...
The logic remains the same.
Also remove `fields` - nothing uses the term `fields` except for the fields projection.
2014-02-23 17:52:17 -08:00
Slava Kim
9d4783e4fc
Additional assert for _safeAppendToBuffer
2014-02-23 17:51:51 -08:00
Slava Kim
622d61f0a7
fix tests' setsEqual
2014-02-21 20:03:22 -08:00
Slava Kim
9ccdc0b80c
Don't repoll if everything fits into buffer;
...
Use EJSON.equals
Better comments
2014-02-21 20:02:19 -08:00
Slava Kim
a6410c4af7
A comment on Min-Max-Heap implementation
2014-02-21 18:23:58 -08:00
Slava Kim
f38294b173
Binary-Heap: update in-place
2014-02-21 18:19:13 -08:00
Slava Kim
1dc172696f
minor stylish tweak
2014-02-21 18:12:35 -08:00
Slava Kim
133428e6e5
Fix the removal and the priority of _maxIndex.
...
Removing an arbitary element you might need to upHeap the position of removed
element instead of downHeap. It is not the case with the maximum, because root
can't be upHeaped.
2014-02-21 17:48:37 -08:00
Slava Kim
b01ed021ea
New giant randomized test with self-checks
2014-02-21 17:48:22 -08:00
Slava Kim
74553efa30
Binary-heap: avoid capitalized names for non-classes
2014-02-21 14:35:55 -08:00
Slava Kim
e853ced77c
Binary-heap: refactor out the _maxIndex method
2014-02-21 14:35:01 -08:00
Slava Kim
503c5f263f
Extra safety belt for binary-heap constructor
2014-02-21 14:27:32 -08:00
Slava Kim
7bad26e796
Make min-max-heap's clone work in the same way it works for max-heap
2014-02-21 14:25:06 -08:00
Slava Kim
d87b18a56e
Fix building heap from array
2014-02-20 22:38:56 -08:00
Slava Kim
19eeff650a
Implement heap clone with passing an array of the original's data
2014-02-20 21:45:28 -08:00
Slava Kim
006e307f15
More comments on Heap implementation, linear initialization doesn't retain anything but the references to the values.
2014-02-20 21:38:09 -08:00
Slava Kim
cd918bbf17
binary-heap uses id-map
2014-02-20 17:13:52 -08:00
Slava Kim
939d8d7e7f
es3 friendly inheritance
2014-02-20 16:29:01 -08:00
Slava Kim
8c079efcda
Extracted IdMap to a separate package
2014-02-20 16:00:08 -08:00
Slava Kim
3fa5fd9342
binary-heap: Fix rightChildIdx()
2014-02-20 14:05:12 -08:00
Slava Kim
b4e94c3b2a
A randomized test for max-heap
2014-02-20 14:04:27 -08:00
Slava Kim
b76fd3c3af
Rename BinaryHeap to MaxHeap and MaxMinHeap to MinMaxHeap
2014-02-20 13:47:22 -08:00
Slava Kim
23ec5007e9
_justUpdatedBuffer => _safeAppendToBuffer
2014-02-19 12:44:19 -08:00
Slava Kim
6144213649
Tests for updated-buffered which stays in buffer or comes to published
2014-02-18 16:38:03 -08:00