summaryrefslogtreecommitdiff
path: root/ext/librethinkdbxx/test/upstream/changefeeds/geo.rb.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'ext/librethinkdbxx/test/upstream/changefeeds/geo.rb.yaml')
-rw-r--r--ext/librethinkdbxx/test/upstream/changefeeds/geo.rb.yaml27
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/librethinkdbxx/test/upstream/changefeeds/geo.rb.yaml b/ext/librethinkdbxx/test/upstream/changefeeds/geo.rb.yaml
new file mode 100644
index 00000000..7755ff96
--- /dev/null
+++ b/ext/librethinkdbxx/test/upstream/changefeeds/geo.rb.yaml
@@ -0,0 +1,27 @@
+desc: Geo indexed changefeed operations
+table_variable_name: tbl
+tests:
+ - rb: tbl.index_create('L', {geo: true})
+ ot: partial({'created': 1})
+
+ - rb: tbl.index_wait().count
+ ot: 1
+
+ - def: obj11 = {id: "11", L: r.point(1,1)}
+ - def: obj12 = {id: "12", L: r.point(1,2)}
+ - def: obj21 = {id: "21", L: r.point(2,1)}
+ - def: obj22 = {id: "22", L: r.point(2,2)}
+
+ # A distance of 130,000 meters from 1,1 is enough to cover 1,2 and 2,1 (~110km
+ # distance) but not 2,2 (~150km distance.)
+ #
+ # This is useful because the S2LatLngRect bounding box passed to the shards contains
+ # 2,2 yet it should not be returned in the changefeed results.
+ - rb: feed = tbl.get_intersecting(r.circle(r.point(1,1), 130000), {index: "L"}).get_field("id").changes(include_initial: true)
+
+ - rb: tbl.insert([obj11, obj12, obj21, obj22])
+ ot: partial({'errors': 0, 'inserted': 4})
+
+ - rb: fetch(feed, 3)
+ ot: bag([{"new_val" => "11", "old_val" => nil}, {"new_val" => "12", "old_val" => nil}, {"new_val" => "21", "old_val" => nil}])
+