Debian Codegraph @

internal/integration/reql_tests/reql_control_test.go

raw symbols SCIP
1 // Code generated by gen_tests.py and process_polyglot.py.
2 // Do not edit this file directly.
3 // The template for this file is located at:
4 // ../template.go.tpl
5 package reql_tests
6
7 import (
8 "testing"
9 "time"
10
11 "github.com/stretchr/testify/suite"
12 r "gopkg.in/rethinkdb/rethinkdb-go.v6"
13 "gopkg.in/rethinkdb/rethinkdb-go.v6/internal/compare"
14 )
15
16 // Tests RQL control flow structures
17 func TestControlSuite(t *testing.T) {
18 suite.Run(t, new(ControlSuite))
19 }
20
21 type ControlSuite struct {
22 suite.Suite
23
24 session *r.Session
25 }
26
27 func (suite *ControlSuite) SetupTest() {
28 suite.T().Log("Setting up ControlSuite")
29 // Use imports to prevent errors
30 _ = time.Time{}
31 _ = compare.AnythingIsFine
32
33 session, err := r.Connect(r.ConnectOpts{
34 Address: url,
35 })
36 suite.Require().NoError(err, "Error returned when connecting to server")
37 suite.session = session
38
39 r.DBDrop("db_control").Exec(suite.session)
40 err = r.DBCreate("db_control").Exec(suite.session)
41 suite.Require().NoError(err)
42 err = r.DB("db_control").Wait().Exec(suite.session)
43 suite.Require().NoError(err)
44
45 r.DB("db_control").TableDrop("table_test_control").Exec(suite.session)
46 err = r.DB("db_control").TableCreate("table_test_control").Exec(suite.session)
47 suite.Require().NoError(err)
48 err = r.DB("db_control").Table("table_test_control").Wait().Exec(suite.session)
49 suite.Require().NoError(err)
50 r.DB("db_control").TableDrop("table_test_control2").Exec(suite.session)
51 err = r.DB("db_control").TableCreate("table_test_control2").Exec(suite.session)
52 suite.Require().NoError(err)
53 err = r.DB("db_control").Table("table_test_control2").Wait().Exec(suite.session)
54 suite.Require().NoError(err)
55 }
56
57 func (suite *ControlSuite) TearDownSuite() {
58 suite.T().Log("Tearing down ControlSuite")
59
60 if suite.session != nil {
61 r.DB("rethinkdb").Table("_debug_scratch").Delete().Exec(suite.session)
62 r.DB("db_control").TableDrop("table_test_control").Exec(suite.session)
63 r.DB("db_control").TableDrop("table_test_control2").Exec(suite.session)
64 r.DBDrop("db_control").Exec(suite.session)
65
66 suite.session.Close()
67 }
68 }
69
70 func (suite *ControlSuite) TestCases() {
71 suite.T().Log("Running ControlSuite: Tests RQL control flow structures")
72
73 table_test_control := r.DB("db_control").Table("table_test_control")
74 _ = table_test_control // Prevent any noused variable errors
75 table_test_control2 := r.DB("db_control").Table("table_test_control2")
76 _ = table_test_control2 // Prevent any noused variable errors
77
78 {
79 // control.yaml line #7
80 /* 2 */
81 var expected_ int = 2
82 /* r.expr(1).do(lambda v: v * 2) */
83
84 suite.T().Log("About to run line #7: r.Expr(1).Do(func(v r.Term) interface{} { return r.Mul(v, 2)})")
85
86 runAndAssert(suite.Suite, expected_, r.Expr(1).Do(func(v r.Term) interface{} { return r.Mul(v, 2) }), suite.session, r.RunOpts{
87 GeometryFormat: "raw",
88 GroupFormat: "map",
89 })
90 suite.T().Log("Finished running line #7")
91 }
92
93 {
94 // control.yaml line #12
95 /* [0, 1, 2, 3] */
96 var expected_ []interface{} = []interface{}{0, 1, 2, 3}
97 /* r.expr([0, 1, 2]).do(lambda v: v.append(3)) */
98
99 suite.T().Log("About to run line #12: r.Expr([]interface{}{0, 1, 2}).Do(func(v r.Term) interface{} { return v.Append(3)})")
100
101 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{0, 1, 2}).Do(func(v r.Term) interface{} { return v.Append(3) }), suite.session, r.RunOpts{
102 GeometryFormat: "raw",
103 GroupFormat: "map",
104 })
105 suite.T().Log("Finished running line #12")
106 }
107
108 {
109 // control.yaml line #17
110 /* 3 */
111 var expected_ int = 3
112 /* r.do(1, 2, lambda x, y: x + y) */
113
114 suite.T().Log("About to run line #17: r.Do(1, 2, func(x r.Term, y r.Term) interface{} { return r.Add(x, y)})")
115
116 runAndAssert(suite.Suite, expected_, r.Do(1, 2, func(x r.Term, y r.Term) interface{} { return r.Add(x, y) }), suite.session, r.RunOpts{
117 GeometryFormat: "raw",
118 GroupFormat: "map",
119 })
120 suite.T().Log("Finished running line #17")
121 }
122
123 {
124 // control.yaml line #22
125 /* 1 */
126 var expected_ int = 1
127 /* r.do(lambda: 1) */
128
129 suite.T().Log("About to run line #22: r.Do(func() interface{} { return 1})")
130
131 runAndAssert(suite.Suite, expected_, r.Do(func() interface{} { return 1 }), suite.session, r.RunOpts{
132 GeometryFormat: "raw",
133 GroupFormat: "map",
134 })
135 suite.T().Log("Finished running line #22")
136 }
137
138 {
139 // control.yaml line #38
140 /* 1 */
141 var expected_ int = 1
142 /* r.do(1) */
143
144 suite.T().Log("About to run line #38: r.Do(1)")
145
146 runAndAssert(suite.Suite, expected_, r.Do(1), suite.session, r.RunOpts{
147 GeometryFormat: "raw",
148 GroupFormat: "map",
149 })
150 suite.T().Log("Finished running line #38")
151 }
152
153 {
154 // control.yaml line #53
155 /* err("ReqlQueryLogicError", "Expected type ARRAY but found STRING.", [1, 0]) */
156 var expected_ Err = err("ReqlQueryLogicError", "Expected type ARRAY but found STRING.")
157 /* r.expr('abc').do(lambda v: v.append(3)) */
158
159 suite.T().Log("About to run line #53: r.Expr('abc').Do(func(v r.Term) interface{} { return v.Append(3)})")
160
161 runAndAssert(suite.Suite, expected_, r.Expr("abc").Do(func(v r.Term) interface{} { return v.Append(3) }), suite.session, r.RunOpts{
162 GeometryFormat: "raw",
163 GroupFormat: "map",
164 })
165 suite.T().Log("Finished running line #53")
166 }
167
168 {
169 // control.yaml line #58
170 /* err("ReqlQueryLogicError", "Expected type STRING but found NUMBER.", [1, 1]) */
171 var expected_ Err = err("ReqlQueryLogicError", "Expected type STRING but found NUMBER.")
172 /* r.expr('abc').do(lambda v: v + 3) */
173
174 suite.T().Log("About to run line #58: r.Expr('abc').Do(func(v r.Term) interface{} { return r.Add(v, 3)})")
175
176 runAndAssert(suite.Suite, expected_, r.Expr("abc").Do(func(v r.Term) interface{} { return r.Add(v, 3) }), suite.session, r.RunOpts{
177 GeometryFormat: "raw",
178 GroupFormat: "map",
179 })
180 suite.T().Log("Finished running line #58")
181 }
182
183 {
184 // control.yaml line #63
185 /* err("ReqlQueryLogicError", "Expected type STRING but found NUMBER.", [1]) */
186 var expected_ Err = err("ReqlQueryLogicError", "Expected type STRING but found NUMBER.")
187 /* r.expr('abc').do(lambda v: v + 'def') + 3 */
188
189 suite.T().Log("About to run line #63: r.Expr('abc').Do(func(v r.Term) interface{} { return r.Add(v, 'def')}).Add(3)")
190
191 runAndAssert(suite.Suite, expected_, r.Expr("abc").Do(func(v r.Term) interface{} { return r.Add(v, "def") }).Add(3), suite.session, r.RunOpts{
192 GeometryFormat: "raw",
193 GroupFormat: "map",
194 })
195 suite.T().Log("Finished running line #63")
196 }
197
198 {
199 // control.yaml line #78
200 /* 5 */
201 var expected_ int = 5
202 /* r.expr(5).do(r.row) */
203
204 suite.T().Log("About to run line #78: r.Expr(5).Do(r.Row)")
205
206 runAndAssert(suite.Suite, expected_, r.Expr(5).Do(r.Row), suite.session, r.RunOpts{
207 GeometryFormat: "raw",
208 GroupFormat: "map",
209 })
210 suite.T().Log("Finished running line #78")
211 }
212
213 {
214 // control.yaml line #84
215 /* 1 */
216 var expected_ int = 1
217 /* r.branch(True, 1, 2) */
218
219 suite.T().Log("About to run line #84: r.Branch(true, 1, 2)")
220
221 runAndAssert(suite.Suite, expected_, r.Branch(true, 1, 2), suite.session, r.RunOpts{
222 GeometryFormat: "raw",
223 GroupFormat: "map",
224 })
225 suite.T().Log("Finished running line #84")
226 }
227
228 {
229 // control.yaml line #86
230 /* 2 */
231 var expected_ int = 2
232 /* r.branch(False, 1, 2) */
233
234 suite.T().Log("About to run line #86: r.Branch(false, 1, 2)")
235
236 runAndAssert(suite.Suite, expected_, r.Branch(false, 1, 2), suite.session, r.RunOpts{
237 GeometryFormat: "raw",
238 GroupFormat: "map",
239 })
240 suite.T().Log("Finished running line #86")
241 }
242
243 {
244 // control.yaml line #88
245 /* ("c") */
246 var expected_ string = "c"
247 /* r.branch(1, 'c', False) */
248
249 suite.T().Log("About to run line #88: r.Branch(1, 'c', false)")
250
251 runAndAssert(suite.Suite, expected_, r.Branch(1, "c", false), suite.session, r.RunOpts{
252 GeometryFormat: "raw",
253 GroupFormat: "map",
254 })
255 suite.T().Log("Finished running line #88")
256 }
257
258 {
259 // control.yaml line #90
260 /* ([]) */
261 var expected_ []interface{} = []interface{}{}
262 /* r.branch(null, {}, []) */
263
264 suite.T().Log("About to run line #90: r.Branch(nil, map[interface{}]interface{}{}, []interface{}{})")
265
266 runAndAssert(suite.Suite, expected_, r.Branch(nil, map[interface{}]interface{}{}, []interface{}{}), suite.session, r.RunOpts{
267 GeometryFormat: "raw",
268 GroupFormat: "map",
269 })
270 suite.T().Log("Finished running line #90")
271 }
272
273 {
274 // control.yaml line #93
275 /* err("ReqlQueryLogicError", "Expected type DATUM but found DATABASE:", []) */
276 var expected_ Err = err("ReqlQueryLogicError", "Expected type DATUM but found DATABASE:")
277 /* r.branch(r.db('test'), 1, 2) */
278
279 suite.T().Log("About to run line #93: r.Branch(r.DB('test'), 1, 2)")
280
281 runAndAssert(suite.Suite, expected_, r.Branch(r.DB("db_control"), 1, 2), suite.session, r.RunOpts{
282 GeometryFormat: "raw",
283 GroupFormat: "map",
284 })
285 suite.T().Log("Finished running line #93")
286 }
287
288 {
289 // control.yaml line #95
290 /* err("ReqlQueryLogicError", "Expected type DATUM but found TABLE:", []) */
291 var expected_ Err = err("ReqlQueryLogicError", "Expected type DATUM but found TABLE:")
292 /* r.branch(table_test_control, 1, 2) */
293
294 suite.T().Log("About to run line #95: r.Branch(table_test_control, 1, 2)")
295
296 runAndAssert(suite.Suite, expected_, r.Branch(table_test_control, 1, 2), suite.session, r.RunOpts{
297 GeometryFormat: "raw",
298 GroupFormat: "map",
299 })
300 suite.T().Log("Finished running line #95")
301 }
302
303 {
304 // control.yaml line #97
305 /* err("ReqlUserError", "a", []) */
306 var expected_ Err = err("ReqlUserError", "a")
307 /* r.branch(r.error("a"), 1, 2) */
308
309 suite.T().Log("About to run line #97: r.Branch(r.Error('a'), 1, 2)")
310
311 runAndAssert(suite.Suite, expected_, r.Branch(r.Error("a"), 1, 2), suite.session, r.RunOpts{
312 GeometryFormat: "raw",
313 GroupFormat: "map",
314 })
315 suite.T().Log("Finished running line #97")
316 }
317
318 {
319 // control.yaml line #100
320 /* 1 */
321 var expected_ int = 1
322 /* r.branch([], 1, 2) */
323
324 suite.T().Log("About to run line #100: r.Branch([]interface{}{}, 1, 2)")
325
326 runAndAssert(suite.Suite, expected_, r.Branch([]interface{}{}, 1, 2), suite.session, r.RunOpts{
327 GeometryFormat: "raw",
328 GroupFormat: "map",
329 })
330 suite.T().Log("Finished running line #100")
331 }
332
333 {
334 // control.yaml line #102
335 /* 1 */
336 var expected_ int = 1
337 /* r.branch({}, 1, 2) */
338
339 suite.T().Log("About to run line #102: r.Branch(map[interface{}]interface{}{}, 1, 2)")
340
341 runAndAssert(suite.Suite, expected_, r.Branch(map[interface{}]interface{}{}, 1, 2), suite.session, r.RunOpts{
342 GeometryFormat: "raw",
343 GroupFormat: "map",
344 })
345 suite.T().Log("Finished running line #102")
346 }
347
348 {
349 // control.yaml line #104
350 /* 1 */
351 var expected_ int = 1
352 /* r.branch("a", 1, 2) */
353
354 suite.T().Log("About to run line #104: r.Branch('a', 1, 2)")
355
356 runAndAssert(suite.Suite, expected_, r.Branch("a", 1, 2), suite.session, r.RunOpts{
357 GeometryFormat: "raw",
358 GroupFormat: "map",
359 })
360 suite.T().Log("Finished running line #104")
361 }
362
363 {
364 // control.yaml line #106
365 /* 1 */
366 var expected_ int = 1
367 /* r.branch(1.2, 1, 2) */
368
369 suite.T().Log("About to run line #106: r.Branch(1.2, 1, 2)")
370
371 runAndAssert(suite.Suite, expected_, r.Branch(1.2, 1, 2), suite.session, r.RunOpts{
372 GeometryFormat: "raw",
373 GroupFormat: "map",
374 })
375 suite.T().Log("Finished running line #106")
376 }
377
378 {
379 // control.yaml line #109
380 /* 1 */
381 var expected_ int = 1
382 /* r.branch(True, 1, True, 2, 3) */
383
384 suite.T().Log("About to run line #109: r.Branch(true, 1, true, 2, 3)")
385
386 runAndAssert(suite.Suite, expected_, r.Branch(true, 1, true, 2, 3), suite.session, r.RunOpts{
387 GeometryFormat: "raw",
388 GroupFormat: "map",
389 })
390 suite.T().Log("Finished running line #109")
391 }
392
393 {
394 // control.yaml line #111
395 /* 1 */
396 var expected_ int = 1
397 /* r.branch(True, 1, False, 2, 3) */
398
399 suite.T().Log("About to run line #111: r.Branch(true, 1, false, 2, 3)")
400
401 runAndAssert(suite.Suite, expected_, r.Branch(true, 1, false, 2, 3), suite.session, r.RunOpts{
402 GeometryFormat: "raw",
403 GroupFormat: "map",
404 })
405 suite.T().Log("Finished running line #111")
406 }
407
408 {
409 // control.yaml line #113
410 /* 2 */
411 var expected_ int = 2
412 /* r.branch(False, 1, True, 2, 3) */
413
414 suite.T().Log("About to run line #113: r.Branch(false, 1, true, 2, 3)")
415
416 runAndAssert(suite.Suite, expected_, r.Branch(false, 1, true, 2, 3), suite.session, r.RunOpts{
417 GeometryFormat: "raw",
418 GroupFormat: "map",
419 })
420 suite.T().Log("Finished running line #113")
421 }
422
423 {
424 // control.yaml line #115
425 /* 3 */
426 var expected_ int = 3
427 /* r.branch(False, 1, False, 2, 3) */
428
429 suite.T().Log("About to run line #115: r.Branch(false, 1, false, 2, 3)")
430
431 runAndAssert(suite.Suite, expected_, r.Branch(false, 1, false, 2, 3), suite.session, r.RunOpts{
432 GeometryFormat: "raw",
433 GroupFormat: "map",
434 })
435 suite.T().Log("Finished running line #115")
436 }
437
438 {
439 // control.yaml line #118
440 /* err("ReqlQueryLogicError", "Cannot call `branch` term with an even number of arguments.") */
441 var expected_ Err = err("ReqlQueryLogicError", "Cannot call `branch` term with an even number of arguments.")
442 /* r.branch(True, 1, True, 2) */
443
444 suite.T().Log("About to run line #118: r.Branch(true, 1, true, 2)")
445
446 runAndAssert(suite.Suite, expected_, r.Branch(true, 1, true, 2), suite.session, r.RunOpts{
447 GeometryFormat: "raw",
448 GroupFormat: "map",
449 })
450 suite.T().Log("Finished running line #118")
451 }
452
453 {
454 // control.yaml line #122
455 /* err("ReqlUserError", "Hello World", [0]) */
456 var expected_ Err = err("ReqlUserError", "Hello World")
457 /* r.error('Hello World') */
458
459 suite.T().Log("About to run line #122: r.Error('Hello World')")
460
461 runAndAssert(suite.Suite, expected_, r.Error("Hello World"), suite.session, r.RunOpts{
462 GeometryFormat: "raw",
463 GroupFormat: "map",
464 })
465 suite.T().Log("Finished running line #122")
466 }
467
468 {
469 // control.yaml line #125
470 /* err("ReqlQueryLogicError", "Expected type STRING but found NUMBER.", [0]) */
471 var expected_ Err = err("ReqlQueryLogicError", "Expected type STRING but found NUMBER.")
472 /* r.error(5) */
473
474 suite.T().Log("About to run line #125: r.Error(5)")
475
476 runAndAssert(suite.Suite, expected_, r.Error(5), suite.session, r.RunOpts{
477 GeometryFormat: "raw",
478 GroupFormat: "map",
479 })
480 suite.T().Log("Finished running line #125")
481 }
482
483 {
484 // control.yaml line #140
485 /* 2 */
486 var expected_ int = 2
487 /* r.js('1 + 1') */
488
489 suite.T().Log("About to run line #140: r.JS('1 + 1')")
490
491 runAndAssert(suite.Suite, expected_, r.JS("1 + 1"), suite.session, r.RunOpts{
492 GeometryFormat: "raw",
493 GroupFormat: "map",
494 })
495 suite.T().Log("Finished running line #140")
496 }
497
498 {
499 // control.yaml line #143
500 /* 4 */
501 var expected_ int = 4
502 /* r.js('1 + 1; 2 + 2') */
503
504 suite.T().Log("About to run line #143: r.JS('1 + 1; 2 + 2')")
505
506 runAndAssert(suite.Suite, expected_, r.JS("1 + 1; 2 + 2"), suite.session, r.RunOpts{
507 GeometryFormat: "raw",
508 GroupFormat: "map",
509 })
510 suite.T().Log("Finished running line #143")
511 }
512
513 {
514 // control.yaml line #146
515 /* 3 */
516 var expected_ int = 3
517 /* r.do(1, 2, r.js('(function(a, b) { return a + b; })')) */
518
519 suite.T().Log("About to run line #146: r.Do(1, 2, r.JS('(function(a, b) { return a + b; })'))")
520
521 runAndAssert(suite.Suite, expected_, r.Do(1, 2, r.JS("(function(a, b) { return a + b; })")), suite.session, r.RunOpts{
522 GeometryFormat: "raw",
523 GroupFormat: "map",
524 })
525 suite.T().Log("Finished running line #146")
526 }
527
528 {
529 // control.yaml line #149
530 /* 2 */
531 var expected_ int = 2
532 /* r.expr(1).do(r.js('(function(x) { return x + 1; })')) */
533
534 suite.T().Log("About to run line #149: r.Expr(1).Do(r.JS('(function(x) { return x + 1; })'))")
535
536 runAndAssert(suite.Suite, expected_, r.Expr(1).Do(r.JS("(function(x) { return x + 1; })")), suite.session, r.RunOpts{
537 GeometryFormat: "raw",
538 GroupFormat: "map",
539 })
540 suite.T().Log("Finished running line #149")
541 }
542
543 {
544 // control.yaml line #152
545 /* 'foobar' */
546 var expected_ string = "foobar"
547 /* r.expr('foo').do(r.js('(function(x) { return x + "bar"; })')) */
548
549 suite.T().Log("About to run line #152: r.Expr('foo').Do(r.JS('(function(x) { return x + \\'bar\\'; })'))")
550
551 runAndAssert(suite.Suite, expected_, r.Expr("foo").Do(r.JS("(function(x) { return x + \"bar\"; })")), suite.session, r.RunOpts{
552 GeometryFormat: "raw",
553 GroupFormat: "map",
554 })
555 suite.T().Log("Finished running line #152")
556 }
557
558 {
559 // control.yaml line #157
560 /* 3 */
561 var expected_ int = 3
562 /* r.js('1 + 2', timeout=1.2) */
563
564 suite.T().Log("About to run line #157: r.JS('1 + 2').OptArgs(r.JSOpts{Timeout: 1.2, })")
565
566 runAndAssert(suite.Suite, expected_, r.JS("1 + 2").OptArgs(r.JSOpts{Timeout: 1.2}), suite.session, r.RunOpts{
567 GeometryFormat: "raw",
568 GroupFormat: "map",
569 })
570 suite.T().Log("Finished running line #157")
571 }
572
573 {
574 // control.yaml line #161
575 /* err("ReqlQueryLogicError", "Query result must be of type DATUM, GROUPED_DATA, or STREAM (got FUNCTION).", [0]) */
576 var expected_ Err = err("ReqlQueryLogicError", "Query result must be of type DATUM, GROUPED_DATA, or STREAM (got FUNCTION).")
577 /* r.js('(function() { return 1; })') */
578
579 suite.T().Log("About to run line #161: r.JS('(function() { return 1; })')")
580
581 runAndAssert(suite.Suite, expected_, r.JS("(function() { return 1; })"), suite.session, r.RunOpts{
582 GeometryFormat: "raw",
583 GroupFormat: "map",
584 })
585 suite.T().Log("Finished running line #161")
586 }
587
588 {
589 // control.yaml line #164
590 /* err("ReqlQueryLogicError", "SyntaxError: Unexpected token (", [0]) */
591 var expected_ Err = err("ReqlQueryLogicError", "SyntaxError: Unexpected token (")
592 /* r.js('function() { return 1; }') */
593
594 suite.T().Log("About to run line #164: r.JS('function() { return 1; }')")
595
596 runAndAssert(suite.Suite, expected_, r.JS("function() { return 1; }"), suite.session, r.RunOpts{
597 GeometryFormat: "raw",
598 GroupFormat: "map",
599 })
600 suite.T().Log("Finished running line #164")
601 }
602
603 {
604 // control.yaml line #168
605 /* 1 */
606 var expected_ int = 1
607 /* r.do(1, 2, r.js('(function(a) { return a; })')) */
608
609 suite.T().Log("About to run line #168: r.Do(1, 2, r.JS('(function(a) { return a; })'))")
610
611 runAndAssert(suite.Suite, expected_, r.Do(1, 2, r.JS("(function(a) { return a; })")), suite.session, r.RunOpts{
612 GeometryFormat: "raw",
613 GroupFormat: "map",
614 })
615 suite.T().Log("Finished running line #168")
616 }
617
618 {
619 // control.yaml line #171
620 /* 1 */
621 var expected_ int = 1
622 /* r.do(1, 2, r.js('(function(a, b, c) { return a; })')) */
623
624 suite.T().Log("About to run line #171: r.Do(1, 2, r.JS('(function(a, b, c) { return a; })'))")
625
626 runAndAssert(suite.Suite, expected_, r.Do(1, 2, r.JS("(function(a, b, c) { return a; })")), suite.session, r.RunOpts{
627 GeometryFormat: "raw",
628 GroupFormat: "map",
629 })
630 suite.T().Log("Finished running line #171")
631 }
632
633 {
634 // control.yaml line #174
635 /* err("ReqlQueryLogicError", "Cannot convert javascript `undefined` to ql::datum_t.", [0]) */
636 var expected_ Err = err("ReqlQueryLogicError", "Cannot convert javascript `undefined` to ql::datum_t.")
637 /* r.do(1, 2, r.js('(function(a, b, c) { return c; })')) */
638
639 suite.T().Log("About to run line #174: r.Do(1, 2, r.JS('(function(a, b, c) { return c; })'))")
640
641 runAndAssert(suite.Suite, expected_, r.Do(1, 2, r.JS("(function(a, b, c) { return c; })")), suite.session, r.RunOpts{
642 GeometryFormat: "raw",
643 GroupFormat: "map",
644 })
645 suite.T().Log("Finished running line #174")
646 }
647
648 {
649 // control.yaml line #177
650 /* ([2, 3]) */
651 var expected_ []interface{} = []interface{}{2, 3}
652 /* r.expr([1, 2, 3]).filter(r.js('(function(a) { return a >= 2; })')) */
653
654 suite.T().Log("About to run line #177: r.Expr([]interface{}{1, 2, 3}).Filter(r.JS('(function(a) { return a >= 2; })'))")
655
656 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).Filter(r.JS("(function(a) { return a >= 2; })")), suite.session, r.RunOpts{
657 GeometryFormat: "raw",
658 GroupFormat: "map",
659 })
660 suite.T().Log("Finished running line #177")
661 }
662
663 {
664 // control.yaml line #180
665 /* ([2, 3, 4]) */
666 var expected_ []interface{} = []interface{}{2, 3, 4}
667 /* r.expr([1, 2, 3]).map(r.js('(function(a) { return a + 1; })')) */
668
669 suite.T().Log("About to run line #180: r.Expr([]interface{}{1, 2, 3}).Map(r.JS('(function(a) { return a + 1; })'))")
670
671 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).Map(r.JS("(function(a) { return a + 1; })")), suite.session, r.RunOpts{
672 GeometryFormat: "raw",
673 GroupFormat: "map",
674 })
675 suite.T().Log("Finished running line #180")
676 }
677
678 {
679 // control.yaml line #183
680 /* err("ReqlQueryLogicError", "Expected type FUNCTION but found DATUM:", [0]) */
681 var expected_ Err = err("ReqlQueryLogicError", "Expected type FUNCTION but found DATUM:")
682 /* r.expr([1, 2, 3]).map(r.js('1')) */
683
684 suite.T().Log("About to run line #183: r.Expr([]interface{}{1, 2, 3}).Map(r.JS('1'))")
685
686 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).Map(r.JS("1")), suite.session, r.RunOpts{
687 GeometryFormat: "raw",
688 GroupFormat: "map",
689 })
690 suite.T().Log("Finished running line #183")
691 }
692
693 {
694 // control.yaml line #186
695 /* err("ReqlQueryLogicError", "Cannot convert javascript `undefined` to ql::datum_t.", [0]) */
696 var expected_ Err = err("ReqlQueryLogicError", "Cannot convert javascript `undefined` to ql::datum_t.")
697 /* r.expr([1, 2, 3]).filter(r.js('(function(a) {})')) */
698
699 suite.T().Log("About to run line #186: r.Expr([]interface{}{1, 2, 3}).Filter(r.JS('(function(a) {})'))")
700
701 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).Filter(r.JS("(function(a) {})")), suite.session, r.RunOpts{
702 GeometryFormat: "raw",
703 GroupFormat: "map",
704 })
705 suite.T().Log("Finished running line #186")
706 }
707
708 {
709 // control.yaml line #190
710 /* err("ReqlQueryLogicError", "Expected type FUNCTION but found DATUM:", [0]) */
711 var expected_ Err = err("ReqlQueryLogicError", "Expected type FUNCTION but found DATUM:")
712 /* r.expr([1, 2, 3]).map(1) */
713
714 suite.T().Log("About to run line #190: r.Expr([]interface{}{1, 2, 3}).Map(1)")
715
716 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).Map(1), suite.session, r.RunOpts{
717 GeometryFormat: "raw",
718 GroupFormat: "map",
719 })
720 suite.T().Log("Finished running line #190")
721 }
722
723 {
724 // control.yaml line #193
725 /* ([1, 2, 3]) */
726 var expected_ []interface{} = []interface{}{1, 2, 3}
727 /* r.expr([1, 2, 3]).filter('foo') */
728
729 suite.T().Log("About to run line #193: r.Expr([]interface{}{1, 2, 3}).Filter('foo')")
730
731 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).Filter("foo"), suite.session, r.RunOpts{
732 GeometryFormat: "raw",
733 GroupFormat: "map",
734 })
735 suite.T().Log("Finished running line #193")
736 }
737
738 {
739 // control.yaml line #195
740 /* ([1, 2, 4]) */
741 var expected_ []interface{} = []interface{}{1, 2, 4}
742 /* r.expr([1, 2, 4]).filter([]) */
743
744 suite.T().Log("About to run line #195: r.Expr([]interface{}{1, 2, 4}).Filter([]interface{}{})")
745
746 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 4}).Filter([]interface{}{}), suite.session, r.RunOpts{
747 GeometryFormat: "raw",
748 GroupFormat: "map",
749 })
750 suite.T().Log("Finished running line #195")
751 }
752
753 {
754 // control.yaml line #197
755 /* ([]) */
756 var expected_ []interface{} = []interface{}{}
757 /* r.expr([1, 2, 3]).filter(null) */
758
759 suite.T().Log("About to run line #197: r.Expr([]interface{}{1, 2, 3}).Filter(nil)")
760
761 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).Filter(nil), suite.session, r.RunOpts{
762 GeometryFormat: "raw",
763 GroupFormat: "map",
764 })
765 suite.T().Log("Finished running line #197")
766 }
767
768 {
769 // control.yaml line #200
770 /* ([]) */
771 var expected_ []interface{} = []interface{}{}
772 /* r.expr([1, 2, 4]).filter(False) */
773
774 suite.T().Log("About to run line #200: r.Expr([]interface{}{1, 2, 4}).Filter(false)")
775
776 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 4}).Filter(false), suite.session, r.RunOpts{
777 GeometryFormat: "raw",
778 GroupFormat: "map",
779 })
780 suite.T().Log("Finished running line #200")
781 }
782
783 {
784 // control.yaml line #205
785 /* 0 */
786 var expected_ int = 0
787 /* table_test_control.count() */
788
789 suite.T().Log("About to run line #205: table_test_control.Count()")
790
791 runAndAssert(suite.Suite, expected_, table_test_control.Count(), suite.session, r.RunOpts{
792 GeometryFormat: "raw",
793 GroupFormat: "map",
794 })
795 suite.T().Log("Finished running line #205")
796 }
797
798 {
799 // control.yaml line #210
800 /* ({'deleted':0.0,'replaced':0.0,'unchanged':0.0,'errors':0.0,'skipped':0.0,'inserted':3}) */
801 var expected_ map[interface{}]interface{} = map[interface{}]interface{}{"deleted": 0.0, "replaced": 0.0, "unchanged": 0.0, "errors": 0.0, "skipped": 0.0, "inserted": 3}
802 /* r.expr([1, 2, 3]).for_each(lambda row:table_test_control.insert({ 'id':row })) */
803
804 suite.T().Log("About to run line #210: r.Expr([]interface{}{1, 2, 3}).ForEach(func(row r.Term) interface{} { return table_test_control.Insert(map[interface{}]interface{}{'id': row, })})")
805
806 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).ForEach(func(row r.Term) interface{} { return table_test_control.Insert(map[interface{}]interface{}{"id": row}) }), suite.session, r.RunOpts{
807 GeometryFormat: "raw",
808 GroupFormat: "map",
809 })
810 suite.T().Log("Finished running line #210")
811 }
812
813 {
814 // control.yaml line #214
815 /* 3 */
816 var expected_ int = 3
817 /* table_test_control.count() */
818
819 suite.T().Log("About to run line #214: table_test_control.Count()")
820
821 runAndAssert(suite.Suite, expected_, table_test_control.Count(), suite.session, r.RunOpts{
822 GeometryFormat: "raw",
823 GroupFormat: "map",
824 })
825 suite.T().Log("Finished running line #214")
826 }
827
828 {
829 // control.yaml line #219
830 /* ({'deleted':0.0,'replaced':9,'unchanged':0.0,'errors':0.0,'skipped':0.0,'inserted':0.0}) */
831 var expected_ map[interface{}]interface{} = map[interface{}]interface{}{"deleted": 0.0, "replaced": 9, "unchanged": 0.0, "errors": 0.0, "skipped": 0.0, "inserted": 0.0}
832 /* r.expr([1,2,3]).for_each(lambda row:table_test_control.update({'foo':row})) */
833
834 suite.T().Log("About to run line #219: r.Expr([]interface{}{1, 2, 3}).ForEach(func(row r.Term) interface{} { return table_test_control.Update(map[interface{}]interface{}{'foo': row, })})")
835
836 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).ForEach(func(row r.Term) interface{} {
837 return table_test_control.Update(map[interface{}]interface{}{"foo": row})
838 }), suite.session, r.RunOpts{
839 GeometryFormat: "raw",
840 GroupFormat: "map",
841 })
842 suite.T().Log("Finished running line #219")
843 }
844
845 {
846 // control.yaml line #225
847 /* {'first_error':"Duplicate primary key `id`:\n{\n\t\"foo\":\t3,\n\t\"id\":\t1\n}\n{\n\t\"id\":\t1\n}",'deleted':0.0,'replaced':0.0,'unchanged':0.0,'errors':3,'skipped':0.0,'inserted':3} */
848 var expected_ map[interface{}]interface{} = map[interface{}]interface{}{"first_error": "Duplicate primary key `id`:\n{\n\t\"foo\":\t3,\n\t\"id\":\t1\n}\n{\n\t\"id\":\t1\n}", "deleted": 0.0, "replaced": 0.0, "unchanged": 0.0, "errors": 3, "skipped": 0.0, "inserted": 3}
849 /* r.expr([1,2,3]).for_each(lambda row:[table_test_control.insert({ 'id':row }), table_test_control.insert({ 'id':row*10 })]) */
850
851 suite.T().Log("About to run line #225: r.Expr([]interface{}{1, 2, 3}).ForEach(func(row r.Term) interface{} { return []interface{}{table_test_control.Insert(map[interface{}]interface{}{'id': row, }), table_test_control.Insert(map[interface{}]interface{}{'id': r.Mul(row, 10), })}})")
852
853 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).ForEach(func(row r.Term) interface{} {
854 return []interface{}{table_test_control.Insert(map[interface{}]interface{}{"id": row}), table_test_control.Insert(map[interface{}]interface{}{"id": r.Mul(row, 10)})}
855 }), suite.session, r.RunOpts{
856 GeometryFormat: "raw",
857 GroupFormat: "map",
858 })
859 suite.T().Log("Finished running line #225")
860 }
861
862 {
863 // control.yaml line #229
864 /* 6 */
865 var expected_ int = 6
866 /* table_test_control.count() */
867
868 suite.T().Log("About to run line #229: table_test_control.Count()")
869
870 runAndAssert(suite.Suite, expected_, table_test_control.Count(), suite.session, r.RunOpts{
871 GeometryFormat: "raw",
872 GroupFormat: "map",
873 })
874 suite.T().Log("Finished running line #229")
875 }
876
877 {
878 // control.yaml line #232
879 /* ({'deleted':0.0,'replaced':0.0,'generated_keys':arrlen(3,uuid()),'unchanged':0.0,'errors':0.0,'skipped':0.0,'inserted':3}) */
880 var expected_ map[interface{}]interface{} = map[interface{}]interface{}{"deleted": 0.0, "replaced": 0.0, "generated_keys": arrlen(3, compare.IsUUID()), "unchanged": 0.0, "errors": 0.0, "skipped": 0.0, "inserted": 3}
881 /* r.expr([1, 2, 3]).for_each( table_test_control2.insert({}) ) */
882
883 suite.T().Log("About to run line #232: r.Expr([]interface{}{1, 2, 3}).ForEach(table_test_control2.Insert(map[interface{}]interface{}{}))")
884
885 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).ForEach(table_test_control2.Insert(map[interface{}]interface{}{})), suite.session, r.RunOpts{
886 GeometryFormat: "raw",
887 GroupFormat: "map",
888 })
889 suite.T().Log("Finished running line #232")
890 }
891
892 {
893 // control.yaml line #235
894 /* 1 */
895 var expected_ int = 1
896 /* table_test_control2.count() */
897
898 suite.T().Log("About to run line #235: table_test_control2.Count()")
899
900 runAndAssert(suite.Suite, expected_, table_test_control2.Count(), suite.session, r.RunOpts{
901 GeometryFormat: "raw",
902 GroupFormat: "map",
903 })
904 suite.T().Log("Finished running line #235")
905 }
906
907 {
908 // control.yaml line #240
909 /* ({'deleted':0.0,'replaced':36,'unchanged':0.0,'errors':0.0,'skipped':0.0,'inserted':0.0}) */
910 var expected_ map[interface{}]interface{} = map[interface{}]interface{}{"deleted": 0.0, "replaced": 36, "unchanged": 0.0, "errors": 0.0, "skipped": 0.0, "inserted": 0.0}
911 /* r.expr([1,2,3]).for_each(lambda row:[table_test_control.update({'foo':row}), table_test_control.update({'bar':row})]) */
912
913 suite.T().Log("About to run line #240: r.Expr([]interface{}{1, 2, 3}).ForEach(func(row r.Term) interface{} { return []interface{}{table_test_control.Update(map[interface{}]interface{}{'foo': row, }), table_test_control.Update(map[interface{}]interface{}{'bar': row, })}})")
914
915 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).ForEach(func(row r.Term) interface{} {
916 return []interface{}{table_test_control.Update(map[interface{}]interface{}{"foo": row}), table_test_control.Update(map[interface{}]interface{}{"bar": row})}
917 }), suite.session, r.RunOpts{
918 GeometryFormat: "raw",
919 GroupFormat: "map",
920 })
921 suite.T().Log("Finished running line #240")
922 }
923
924 {
925 // control.yaml line #245
926 /* ({'deleted':0.0,'replaced':0.0,'unchanged':0.0,'errors':0.0,'skipped':0.0,'inserted':3}) */
927 var expected_ map[interface{}]interface{} = map[interface{}]interface{}{"deleted": 0.0, "replaced": 0.0, "unchanged": 0.0, "errors": 0.0, "skipped": 0.0, "inserted": 3}
928 /* r.expr([1, 2, 3]).for_each( table_test_control2.insert({ 'id':r.row }) ) */
929
930 suite.T().Log("About to run line #245: r.Expr([]interface{}{1, 2, 3}).ForEach(table_test_control2.Insert(map[interface{}]interface{}{'id': r.Row, }))")
931
932 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).ForEach(table_test_control2.Insert(map[interface{}]interface{}{"id": r.Row})), suite.session, r.RunOpts{
933 GeometryFormat: "raw",
934 GroupFormat: "map",
935 })
936 suite.T().Log("Finished running line #245")
937 }
938
939 {
940 // control.yaml line #249
941 /* err("ReqlQueryLogicError", "FOR_EACH expects one or more basic write queries. Expected type ARRAY but found NUMBER.", [0]) */
942 var expected_ Err = err("ReqlQueryLogicError", "FOR_EACH expects one or more basic write queries. Expected type ARRAY but found NUMBER.")
943 /* r.expr([1, 2, 3]).for_each(1) */
944
945 suite.T().Log("About to run line #249: r.Expr([]interface{}{1, 2, 3}).ForEach(1)")
946
947 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).ForEach(1), suite.session, r.RunOpts{
948 GeometryFormat: "raw",
949 GroupFormat: "map",
950 })
951 suite.T().Log("Finished running line #249")
952 }
953
954 {
955 // control.yaml line #252
956 /* err("ReqlQueryLogicError", "FOR_EACH expects one or more basic write queries. Expected type ARRAY but found NUMBER.", [1, 1]) */
957 var expected_ Err = err("ReqlQueryLogicError", "FOR_EACH expects one or more basic write queries. Expected type ARRAY but found NUMBER.")
958 /* r.expr([1, 2, 3]).for_each(lambda x:x) */
959
960 suite.T().Log("About to run line #252: r.Expr([]interface{}{1, 2, 3}).ForEach(func(x r.Term) interface{} { return x})")
961
962 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).ForEach(func(x r.Term) interface{} { return x }), suite.session, r.RunOpts{
963 GeometryFormat: "raw",
964 GroupFormat: "map",
965 })
966 suite.T().Log("Finished running line #252")
967 }
968
969 {
970 // control.yaml line #257
971 /* err("ReqlQueryLogicError", "FOR_EACH expects one or more basic write queries. Expected type ARRAY but found NUMBER.", [1, 1]) */
972 var expected_ Err = err("ReqlQueryLogicError", "FOR_EACH expects one or more basic write queries. Expected type ARRAY but found NUMBER.")
973 /* r.expr([1, 2, 3]).for_each(r.row) */
974
975 suite.T().Log("About to run line #257: r.Expr([]interface{}{1, 2, 3}).ForEach(r.Row)")
976
977 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).ForEach(r.Row), suite.session, r.RunOpts{
978 GeometryFormat: "raw",
979 GroupFormat: "map",
980 })
981 suite.T().Log("Finished running line #257")
982 }
983
984 {
985 // control.yaml line #262
986 /* err("ReqlQueryLogicError", "FOR_EACH expects one or more basic write queries.", [1, 1]) */
987 var expected_ Err = err("ReqlQueryLogicError", "FOR_EACH expects one or more basic write queries.")
988 /* r.expr([1, 2, 3]).for_each(lambda row:table_test_control) */
989
990 suite.T().Log("About to run line #262: r.Expr([]interface{}{1, 2, 3}).ForEach(func(row r.Term) interface{} { return table_test_control})")
991
992 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2, 3}).ForEach(func(row r.Term) interface{} { return table_test_control }), suite.session, r.RunOpts{
993 GeometryFormat: "raw",
994 GroupFormat: "map",
995 })
996 suite.T().Log("Finished running line #262")
997 }
998
999 {
1000 // control.yaml line #271
1001 /* ({'deleted':0.0,'replaced':0.0,'generated_keys':arrlen(1,uuid()),'unchanged':0.0,'errors':0.0,'skipped':0.0,'inserted':1}) */
1002 var expected_ map[interface{}]interface{} = map[interface{}]interface{}{"deleted": 0.0, "replaced": 0.0, "generated_keys": arrlen(1, compare.IsUUID()), "unchanged": 0.0, "errors": 0.0, "skipped": 0.0, "inserted": 1}
1003 /* r.expr(1).do(table_test_control.insert({'foo':r.row})) */
1004
1005 suite.T().Log("About to run line #271: r.Expr(1).Do(table_test_control.Insert(map[interface{}]interface{}{'foo': r.Row, }))")
1006
1007 runAndAssert(suite.Suite, expected_, r.Expr(1).Do(table_test_control.Insert(map[interface{}]interface{}{"foo": r.Row})), suite.session, r.RunOpts{
1008 GeometryFormat: "raw",
1009 GroupFormat: "map",
1010 })
1011 suite.T().Log("Finished running line #271")
1012 }
1013
1014 {
1015 // control.yaml line #275
1016 /* ({'deleted':0.0,'replaced':0.0,'generated_keys':arrlen(1,uuid()),'unchanged':0.0,'errors':0.0,'skipped':0.0,'inserted':1}) */
1017 var expected_ map[interface{}]interface{} = map[interface{}]interface{}{"deleted": 0.0, "replaced": 0.0, "generated_keys": arrlen(1, compare.IsUUID()), "unchanged": 0.0, "errors": 0.0, "skipped": 0.0, "inserted": 1}
1018 /* r.expr([1, 2])[0].do(table_test_control.insert({'foo':r.row})) */
1019
1020 suite.T().Log("About to run line #275: r.Expr([]interface{}{1, 2}).AtIndex(0).Do(table_test_control.Insert(map[interface{}]interface{}{'foo': r.Row, }))")
1021
1022 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2}).AtIndex(0).Do(table_test_control.Insert(map[interface{}]interface{}{"foo": r.Row})), suite.session, r.RunOpts{
1023 GeometryFormat: "raw",
1024 GroupFormat: "map",
1025 })
1026 suite.T().Log("Finished running line #275")
1027 }
1028
1029 {
1030 // control.yaml line #280
1031 /* err('ReqlCompileError', 'Cannot nest writes or meta ops in stream operations. Use FOR_EACH instead.', [0]) */
1032 var expected_ Err = err("ReqlCompileError", "Cannot nest writes or meta ops in stream operations. Use FOR_EACH instead.")
1033 /* r.expr([1, 2]).map(table_test_control.insert({'foo':r.row})) */
1034
1035 suite.T().Log("About to run line #280: r.Expr([]interface{}{1, 2}).Map(table_test_control.Insert(map[interface{}]interface{}{'foo': r.Row, }))")
1036
1037 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2}).Map(table_test_control.Insert(map[interface{}]interface{}{"foo": r.Row})), suite.session, r.RunOpts{
1038 GeometryFormat: "raw",
1039 GroupFormat: "map",
1040 })
1041 suite.T().Log("Finished running line #280")
1042 }
1043
1044 {
1045 // control.yaml line #284
1046 /* err('ReqlCompileError', 'Cannot nest writes or meta ops in stream operations. Use FOR_EACH instead.', [0]) */
1047 var expected_ Err = err("ReqlCompileError", "Cannot nest writes or meta ops in stream operations. Use FOR_EACH instead.")
1048 /* r.expr([1, 2]).map(r.db('test').table_create('table_create_failure')) */
1049
1050 suite.T().Log("About to run line #284: r.Expr([]interface{}{1, 2}).Map(r.DB('test').TableCreate('table_create_failure'))")
1051
1052 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2}).Map(r.DB("db_control").TableCreate("table_create_failure")), suite.session, r.RunOpts{
1053 GeometryFormat: "raw",
1054 GroupFormat: "map",
1055 })
1056 suite.T().Log("Finished running line #284")
1057 }
1058
1059 {
1060 // control.yaml line #287
1061 /* err('ReqlCompileError', 'Cannot nest writes or meta ops in stream operations. Use FOR_EACH instead.', [0]) */
1062 var expected_ Err = err("ReqlCompileError", "Cannot nest writes or meta ops in stream operations. Use FOR_EACH instead.")
1063 /* r.expr([1, 2]).map(table_test_control.insert({'foo':r.row}).get_field('inserted')) */
1064
1065 suite.T().Log("About to run line #287: r.Expr([]interface{}{1, 2}).Map(table_test_control.Insert(map[interface{}]interface{}{'foo': r.Row, }).Field('inserted'))")
1066
1067 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2}).Map(table_test_control.Insert(map[interface{}]interface{}{"foo": r.Row}).Field("inserted")), suite.session, r.RunOpts{
1068 GeometryFormat: "raw",
1069 GroupFormat: "map",
1070 })
1071 suite.T().Log("Finished running line #287")
1072 }
1073
1074 {
1075 // control.yaml line #291
1076 /* err('ReqlCompileError', 'Cannot nest writes or meta ops in stream operations. Use FOR_EACH instead.', [0]) */
1077 var expected_ Err = err("ReqlCompileError", "Cannot nest writes or meta ops in stream operations. Use FOR_EACH instead.")
1078 /* r.expr([1, 2]).map(table_test_control.insert({'foo':r.row}).get_field('inserted').add(5)) */
1079
1080 suite.T().Log("About to run line #291: r.Expr([]interface{}{1, 2}).Map(table_test_control.Insert(map[interface{}]interface{}{'foo': r.Row, }).Field('inserted').Add(5))")
1081
1082 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{1, 2}).Map(table_test_control.Insert(map[interface{}]interface{}{"foo": r.Row}).Field("inserted").Add(5)), suite.session, r.RunOpts{
1083 GeometryFormat: "raw",
1084 GroupFormat: "map",
1085 })
1086 suite.T().Log("Finished running line #291")
1087 }
1088
1089 {
1090 // control.yaml line #295
1091 /* partial({'tables_created':1}) */
1092 var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"tables_created": 1})
1093 /* r.expr(1).do(r.db('test').table_create('table_create_success')) */
1094
1095 suite.T().Log("About to run line #295: r.Expr(1).Do(r.DB('test').TableCreate('table_create_success'))")
1096
1097 runAndAssert(suite.Suite, expected_, r.Expr(1).Do(r.DB("db_control").TableCreate("table_create_success")), suite.session, r.RunOpts{
1098 GeometryFormat: "raw",
1099 GroupFormat: "map",
1100 })
1101 suite.T().Log("Finished running line #295")
1102 }
1103 }