summaryrefslogtreecommitdiff
path: root/ext/librethinkdbxx/test/upstream/transform/table.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'ext/librethinkdbxx/test/upstream/transform/table.yaml')
-rw-r--r--ext/librethinkdbxx/test/upstream/transform/table.yaml19
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/librethinkdbxx/test/upstream/transform/table.yaml b/ext/librethinkdbxx/test/upstream/transform/table.yaml
new file mode 100644
index 00000000..9f14c90a
--- /dev/null
+++ b/ext/librethinkdbxx/test/upstream/transform/table.yaml
@@ -0,0 +1,19 @@
+desc: Tests manipulation operations on tables
+table_variable_name: tbl
+tests:
+ # Add some data
+ - cd: tbl.insert([{"a":["k1","v1"]},{"a":["k2","v2"]}])
+
+ # Coerce to an object (after map)
+ - js: tbl.map(r.row("a")).coerce_to("object")
+ rb: tbl.map{|row| row["a"]}.coerce_to("object")
+ py: tbl.map(r.row["a"]).coerce_to("object")
+ ot: {"k1":"v1","k2":"v2"}
+
+ # Coerce to an array
+ - cd: tbl.limit(1).type_of()
+ ot: "SELECTION<STREAM>"
+
+ - cd: tbl.limit(1).coerce_to('array').type_of()
+ ot: "ARRAY"
+