gopkg.in/rethinkdb/rethinkdb-go.v6@v6.2.2/internal/integration/reql_tests/reql_times_api_test.go (about) 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 // date/time api (#977) 17 func TestTimesApiSuite(t *testing.T) { 18 suite.Run(t, new(TimesApiSuite)) 19 } 20 21 type TimesApiSuite struct { 22 suite.Suite 23 24 session *r.Session 25 } 26 27 func (suite *TimesApiSuite) SetupTest() { 28 suite.T().Log("Setting up TimesApiSuite") 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("test").Exec(suite.session) 40 err = r.DBCreate("test").Exec(suite.session) 41 suite.Require().NoError(err) 42 err = r.DB("test").Wait().Exec(suite.session) 43 suite.Require().NoError(err) 44 45 } 46 47 func (suite *TimesApiSuite) TearDownSuite() { 48 suite.T().Log("Tearing down TimesApiSuite") 49 50 if suite.session != nil { 51 r.DB("rethinkdb").Table("_debug_scratch").Delete().Exec(suite.session) 52 r.DBDrop("test").Exec(suite.session) 53 54 suite.session.Close() 55 } 56 } 57 58 func (suite *TimesApiSuite) TestCases() { 59 suite.T().Log("Running TimesApiSuite: date/time api (#977)") 60 61 // times/api.yaml line #6 62 // rt1 = 1375147296.6812 63 suite.T().Log("Possibly executing: var rt1 float64 = 1375147296.6812") 64 65 rt1 := 1375147296.6812 66 _ = rt1 // Prevent any noused variable errors 67 68 // times/api.yaml line #7 69 // t1 = r.epoch_time(rt1) 70 suite.T().Log("Possibly executing: var t1 r.Term = r.EpochTime(rt1)") 71 72 t1 := r.EpochTime(rt1) 73 _ = t1 // Prevent any noused variable errors 74 75 // times/api.yaml line #8 76 // t2 = r.epoch_time(rt1 + 1000) 77 suite.T().Log("Possibly executing: var t2 r.Term = r.EpochTime(r.Add(rt1, 1000))") 78 79 t2 := r.EpochTime(r.Add(rt1, 1000)) 80 _ = t2 // Prevent any noused variable errors 81 82 { 83 // times/api.yaml line #11 84 /* (1375148296.681) */ 85 var expected_ float64 = 1375148296.681 86 /* (t1 + 1000).to_epoch_time() */ 87 88 suite.T().Log("About to run line #11: r.Add(t1, 1000).ToEpochTime()") 89 90 runAndAssert(suite.Suite, expected_, r.Add(t1, 1000).ToEpochTime(), suite.session, r.RunOpts{ 91 GeometryFormat: "raw", 92 GroupFormat: "map", 93 }) 94 suite.T().Log("Finished running line #11") 95 } 96 97 { 98 // times/api.yaml line #14 99 /* (1375146296.681) */ 100 var expected_ float64 = 1375146296.681 101 /* (t1 - 1000).to_epoch_time() */ 102 103 suite.T().Log("About to run line #14: r.Sub(t1, 1000).ToEpochTime()") 104 105 runAndAssert(suite.Suite, expected_, r.Sub(t1, 1000).ToEpochTime(), suite.session, r.RunOpts{ 106 GeometryFormat: "raw", 107 GroupFormat: "map", 108 }) 109 suite.T().Log("Finished running line #14") 110 } 111 112 { 113 // times/api.yaml line #17 114 /* 1000 */ 115 var expected_ int = 1000 116 /* (t1 - (t1 - 1000)) */ 117 118 suite.T().Log("About to run line #17: r.Sub(t1, r.Sub(t1, 1000))") 119 120 runAndAssert(suite.Suite, expected_, r.Sub(t1, r.Sub(t1, 1000)), suite.session, r.RunOpts{ 121 GeometryFormat: "raw", 122 GroupFormat: "map", 123 }) 124 suite.T().Log("Finished running line #17") 125 } 126 127 { 128 // times/api.yaml line #22 129 /* false */ 130 var expected_ bool = false 131 /* (t1 < t1) */ 132 133 suite.T().Log("About to run line #22: r.Lt(t1, t1)") 134 135 runAndAssert(suite.Suite, expected_, r.Lt(t1, t1), suite.session, r.RunOpts{ 136 GeometryFormat: "raw", 137 GroupFormat: "map", 138 }) 139 suite.T().Log("Finished running line #22") 140 } 141 142 { 143 // times/api.yaml line #25 144 /* true */ 145 var expected_ bool = true 146 /* (t1 <= t1) */ 147 148 suite.T().Log("About to run line #25: r.Le(t1, t1)") 149 150 runAndAssert(suite.Suite, expected_, r.Le(t1, t1), suite.session, r.RunOpts{ 151 GeometryFormat: "raw", 152 GroupFormat: "map", 153 }) 154 suite.T().Log("Finished running line #25") 155 } 156 157 { 158 // times/api.yaml line #29 159 /* true */ 160 var expected_ bool = true 161 /* (t1 == t1) */ 162 163 suite.T().Log("About to run line #29: r.Eq(t1, t1)") 164 165 runAndAssert(suite.Suite, expected_, r.Eq(t1, t1), suite.session, r.RunOpts{ 166 GeometryFormat: "raw", 167 GroupFormat: "map", 168 }) 169 suite.T().Log("Finished running line #29") 170 } 171 172 { 173 // times/api.yaml line #32 174 /* false */ 175 var expected_ bool = false 176 /* (t1 != t1) */ 177 178 suite.T().Log("About to run line #32: r.Ne(t1, t1)") 179 180 runAndAssert(suite.Suite, expected_, r.Ne(t1, t1), suite.session, r.RunOpts{ 181 GeometryFormat: "raw", 182 GroupFormat: "map", 183 }) 184 suite.T().Log("Finished running line #32") 185 } 186 187 { 188 // times/api.yaml line #34 189 /* true */ 190 var expected_ bool = true 191 /* (t1 >= t1) */ 192 193 suite.T().Log("About to run line #34: r.Ge(t1, t1)") 194 195 runAndAssert(suite.Suite, expected_, r.Ge(t1, t1), suite.session, r.RunOpts{ 196 GeometryFormat: "raw", 197 GroupFormat: "map", 198 }) 199 suite.T().Log("Finished running line #34") 200 } 201 202 { 203 // times/api.yaml line #37 204 /* false */ 205 var expected_ bool = false 206 /* (t1 > t1) */ 207 208 suite.T().Log("About to run line #37: r.Gt(t1, t1)") 209 210 runAndAssert(suite.Suite, expected_, r.Gt(t1, t1), suite.session, r.RunOpts{ 211 GeometryFormat: "raw", 212 GroupFormat: "map", 213 }) 214 suite.T().Log("Finished running line #37") 215 } 216 217 { 218 // times/api.yaml line #40 219 /* true */ 220 var expected_ bool = true 221 /* (t1 < t2) */ 222 223 suite.T().Log("About to run line #40: r.Lt(t1, t2)") 224 225 runAndAssert(suite.Suite, expected_, r.Lt(t1, t2), suite.session, r.RunOpts{ 226 GeometryFormat: "raw", 227 GroupFormat: "map", 228 }) 229 suite.T().Log("Finished running line #40") 230 } 231 232 { 233 // times/api.yaml line #43 234 /* true */ 235 var expected_ bool = true 236 /* (t1 <= t2) */ 237 238 suite.T().Log("About to run line #43: r.Le(t1, t2)") 239 240 runAndAssert(suite.Suite, expected_, r.Le(t1, t2), suite.session, r.RunOpts{ 241 GeometryFormat: "raw", 242 GroupFormat: "map", 243 }) 244 suite.T().Log("Finished running line #43") 245 } 246 247 { 248 // times/api.yaml line #47 249 /* false */ 250 var expected_ bool = false 251 /* (t1 == t2) */ 252 253 suite.T().Log("About to run line #47: r.Eq(t1, t2)") 254 255 runAndAssert(suite.Suite, expected_, r.Eq(t1, t2), suite.session, r.RunOpts{ 256 GeometryFormat: "raw", 257 GroupFormat: "map", 258 }) 259 suite.T().Log("Finished running line #47") 260 } 261 262 { 263 // times/api.yaml line #50 264 /* true */ 265 var expected_ bool = true 266 /* (t1 != t2) */ 267 268 suite.T().Log("About to run line #50: r.Ne(t1, t2)") 269 270 runAndAssert(suite.Suite, expected_, r.Ne(t1, t2), suite.session, r.RunOpts{ 271 GeometryFormat: "raw", 272 GroupFormat: "map", 273 }) 274 suite.T().Log("Finished running line #50") 275 } 276 277 { 278 // times/api.yaml line #52 279 /* false */ 280 var expected_ bool = false 281 /* (t1 >= t2) */ 282 283 suite.T().Log("About to run line #52: r.Ge(t1, t2)") 284 285 runAndAssert(suite.Suite, expected_, r.Ge(t1, t2), suite.session, r.RunOpts{ 286 GeometryFormat: "raw", 287 GroupFormat: "map", 288 }) 289 suite.T().Log("Finished running line #52") 290 } 291 292 { 293 // times/api.yaml line #55 294 /* false */ 295 var expected_ bool = false 296 /* (t1 > t2) */ 297 298 suite.T().Log("About to run line #55: r.Gt(t1, t2)") 299 300 runAndAssert(suite.Suite, expected_, r.Gt(t1, t2), suite.session, r.RunOpts{ 301 GeometryFormat: "raw", 302 GroupFormat: "map", 303 }) 304 suite.T().Log("Finished running line #55") 305 } 306 307 { 308 // times/api.yaml line #60 309 /* true */ 310 var expected_ bool = true 311 /* t1.during(t1, t1 + 1000) */ 312 313 suite.T().Log("About to run line #60: t1.During(t1, r.Add(t1, 1000))") 314 315 runAndAssert(suite.Suite, expected_, t1.During(t1, r.Add(t1, 1000)), suite.session, r.RunOpts{ 316 GeometryFormat: "raw", 317 GroupFormat: "map", 318 }) 319 suite.T().Log("Finished running line #60") 320 } 321 322 { 323 // times/api.yaml line #64 324 /* false */ 325 var expected_ bool = false 326 /* t1.during(t1, t1 + 1000, left_bound='open') */ 327 328 suite.T().Log("About to run line #64: t1.During(t1, r.Add(t1, 1000)).OptArgs(r.DuringOpts{LeftBound: 'open', })") 329 330 runAndAssert(suite.Suite, expected_, t1.During(t1, r.Add(t1, 1000)).OptArgs(r.DuringOpts{LeftBound: "open"}), suite.session, r.RunOpts{ 331 GeometryFormat: "raw", 332 GroupFormat: "map", 333 }) 334 suite.T().Log("Finished running line #64") 335 } 336 337 { 338 // times/api.yaml line #67 339 /* false */ 340 var expected_ bool = false 341 /* t1.during(t1, t1) */ 342 343 suite.T().Log("About to run line #67: t1.During(t1, t1)") 344 345 runAndAssert(suite.Suite, expected_, t1.During(t1, t1), suite.session, r.RunOpts{ 346 GeometryFormat: "raw", 347 GroupFormat: "map", 348 }) 349 suite.T().Log("Finished running line #67") 350 } 351 352 { 353 // times/api.yaml line #70 354 /* true */ 355 var expected_ bool = true 356 /* t1.during(t1, t1, right_bound='closed') */ 357 358 suite.T().Log("About to run line #70: t1.During(t1, t1).OptArgs(r.DuringOpts{RightBound: 'closed', })") 359 360 runAndAssert(suite.Suite, expected_, t1.During(t1, t1).OptArgs(r.DuringOpts{RightBound: "closed"}), suite.session, r.RunOpts{ 361 GeometryFormat: "raw", 362 GroupFormat: "map", 363 }) 364 suite.T().Log("Finished running line #70") 365 } 366 367 { 368 // times/api.yaml line #77 369 /* 1375142400 */ 370 var expected_ int = 1375142400 371 /* t1.date().to_epoch_time() */ 372 373 suite.T().Log("About to run line #77: t1.Date().ToEpochTime()") 374 375 runAndAssert(suite.Suite, expected_, t1.Date().ToEpochTime(), suite.session, r.RunOpts{ 376 GeometryFormat: "raw", 377 GroupFormat: "map", 378 }) 379 suite.T().Log("Finished running line #77") 380 } 381 382 { 383 // times/api.yaml line #79 384 /* (4896.681) */ 385 var expected_ float64 = 4896.681 386 /* t1.time_of_day() */ 387 388 suite.T().Log("About to run line #79: t1.TimeOfDay()") 389 390 runAndAssert(suite.Suite, expected_, t1.TimeOfDay(), suite.session, r.RunOpts{ 391 GeometryFormat: "raw", 392 GroupFormat: "map", 393 }) 394 suite.T().Log("Finished running line #79") 395 } 396 397 { 398 // times/api.yaml line #81 399 /* 2013 */ 400 var expected_ int = 2013 401 /* t1.year() */ 402 403 suite.T().Log("About to run line #81: t1.Year()") 404 405 runAndAssert(suite.Suite, expected_, t1.Year(), suite.session, r.RunOpts{ 406 GeometryFormat: "raw", 407 GroupFormat: "map", 408 }) 409 suite.T().Log("Finished running line #81") 410 } 411 412 { 413 // times/api.yaml line #83 414 /* 7 */ 415 var expected_ int = 7 416 /* t1.month() */ 417 418 suite.T().Log("About to run line #83: t1.Month()") 419 420 runAndAssert(suite.Suite, expected_, t1.Month(), suite.session, r.RunOpts{ 421 GeometryFormat: "raw", 422 GroupFormat: "map", 423 }) 424 suite.T().Log("Finished running line #83") 425 } 426 427 { 428 // times/api.yaml line #85 429 /* 30 */ 430 var expected_ int = 30 431 /* t1.day() */ 432 433 suite.T().Log("About to run line #85: t1.Day()") 434 435 runAndAssert(suite.Suite, expected_, t1.Day(), suite.session, r.RunOpts{ 436 GeometryFormat: "raw", 437 GroupFormat: "map", 438 }) 439 suite.T().Log("Finished running line #85") 440 } 441 442 { 443 // times/api.yaml line #87 444 /* 2 */ 445 var expected_ int = 2 446 /* t1.day_of_week() */ 447 448 suite.T().Log("About to run line #87: t1.DayOfWeek()") 449 450 runAndAssert(suite.Suite, expected_, t1.DayOfWeek(), suite.session, r.RunOpts{ 451 GeometryFormat: "raw", 452 GroupFormat: "map", 453 }) 454 suite.T().Log("Finished running line #87") 455 } 456 457 { 458 // times/api.yaml line #89 459 /* 211 */ 460 var expected_ int = 211 461 /* t1.day_of_year() */ 462 463 suite.T().Log("About to run line #89: t1.DayOfYear()") 464 465 runAndAssert(suite.Suite, expected_, t1.DayOfYear(), suite.session, r.RunOpts{ 466 GeometryFormat: "raw", 467 GroupFormat: "map", 468 }) 469 suite.T().Log("Finished running line #89") 470 } 471 472 { 473 // times/api.yaml line #91 474 /* 1 */ 475 var expected_ int = 1 476 /* t1.hours() */ 477 478 suite.T().Log("About to run line #91: t1.Hours()") 479 480 runAndAssert(suite.Suite, expected_, t1.Hours(), suite.session, r.RunOpts{ 481 GeometryFormat: "raw", 482 GroupFormat: "map", 483 }) 484 suite.T().Log("Finished running line #91") 485 } 486 487 { 488 // times/api.yaml line #93 489 /* 21 */ 490 var expected_ int = 21 491 /* t1.minutes() */ 492 493 suite.T().Log("About to run line #93: t1.Minutes()") 494 495 runAndAssert(suite.Suite, expected_, t1.Minutes(), suite.session, r.RunOpts{ 496 GeometryFormat: "raw", 497 GroupFormat: "map", 498 }) 499 suite.T().Log("Finished running line #93") 500 } 501 502 { 503 // times/api.yaml line #95 504 /* 36.681 */ 505 var expected_ float64 = 36.681 506 /* t1.seconds() */ 507 508 suite.T().Log("About to run line #95: t1.Seconds()") 509 510 runAndAssert(suite.Suite, expected_, t1.Seconds(), suite.session, r.RunOpts{ 511 GeometryFormat: "raw", 512 GroupFormat: "map", 513 }) 514 suite.T().Log("Finished running line #95") 515 } 516 517 { 518 // times/api.yaml line #99 519 /* (1375165800.1) */ 520 var expected_ float64 = 1375165800.1 521 /* r.time(2013, r.july, 29, 23, 30, 0.1, "-07:00").to_epoch_time() */ 522 523 suite.T().Log("About to run line #99: r.Time(2013, r.July, 29, 23, 30, 0.1, '-07:00').ToEpochTime()") 524 525 runAndAssert(suite.Suite, expected_, r.Time(2013, r.July, 29, 23, 30, 0.1, "-07:00").ToEpochTime(), suite.session, r.RunOpts{ 526 GeometryFormat: "raw", 527 GroupFormat: "map", 528 }) 529 suite.T().Log("Finished running line #99") 530 } 531 532 { 533 // times/api.yaml line #101 534 /* ("-07:00") */ 535 var expected_ string = "-07:00" 536 /* r.time(2013, r.july, 29, 23, 30, 0.1, "-07:00").timezone() */ 537 538 suite.T().Log("About to run line #101: r.Time(2013, r.July, 29, 23, 30, 0.1, '-07:00').Timezone()") 539 540 runAndAssert(suite.Suite, expected_, r.Time(2013, r.July, 29, 23, 30, 0.1, "-07:00").Timezone(), suite.session, r.RunOpts{ 541 GeometryFormat: "raw", 542 GroupFormat: "map", 543 }) 544 suite.T().Log("Finished running line #101") 545 } 546 547 { 548 // times/api.yaml line #103 549 /* err("ReqlQueryLogicError", "Got 6 arguments to TIME (expected 4 or 7).", []) */ 550 var expected_ Err = err("ReqlQueryLogicError", "Got 6 arguments to TIME (expected 4 or 7).") 551 /* r.time(2013, r.july, 29, 23, 30, 0.1).to_epoch_time() */ 552 553 suite.T().Log("About to run line #103: r.Time(2013, r.July, 29, 23, 30, 0.1).ToEpochTime()") 554 555 runAndAssert(suite.Suite, expected_, r.Time(2013, r.July, 29, 23, 30, 0.1).ToEpochTime(), suite.session, r.RunOpts{ 556 GeometryFormat: "raw", 557 GroupFormat: "map", 558 }) 559 suite.T().Log("Finished running line #103") 560 } 561 562 { 563 // times/api.yaml line #105 564 /* err("ReqlQueryLogicError", "Got 6 arguments to TIME (expected 4 or 7).", []) */ 565 var expected_ Err = err("ReqlQueryLogicError", "Got 6 arguments to TIME (expected 4 or 7).") 566 /* r.time(2013, r.july, 29, 23, 30, 0.1).timezone() */ 567 568 suite.T().Log("About to run line #105: r.Time(2013, r.July, 29, 23, 30, 0.1).Timezone()") 569 570 runAndAssert(suite.Suite, expected_, r.Time(2013, r.July, 29, 23, 30, 0.1).Timezone(), suite.session, r.RunOpts{ 571 GeometryFormat: "raw", 572 GroupFormat: "map", 573 }) 574 suite.T().Log("Finished running line #105") 575 } 576 577 { 578 // times/api.yaml line #107 579 /* err("ReqlQueryLogicError", "Got 5 arguments to TIME (expected 4 or 7).", []) */ 580 var expected_ Err = err("ReqlQueryLogicError", "Got 5 arguments to TIME (expected 4 or 7).") 581 /* r.time(2013, r.july, 29, 23, 30).to_epoch_time() */ 582 583 suite.T().Log("About to run line #107: r.Time(2013, r.July, 29, 23, 30).ToEpochTime()") 584 585 runAndAssert(suite.Suite, expected_, r.Time(2013, r.July, 29, 23, 30).ToEpochTime(), suite.session, r.RunOpts{ 586 GeometryFormat: "raw", 587 GroupFormat: "map", 588 }) 589 suite.T().Log("Finished running line #107") 590 } 591 592 { 593 // times/api.yaml line #109 594 /* err("ReqlQueryLogicError", "Expected type STRING but found NUMBER.", []) */ 595 var expected_ Err = err("ReqlQueryLogicError", "Expected type STRING but found NUMBER.") 596 /* r.time(2013, r.july, 29, 23).to_epoch_time() */ 597 598 suite.T().Log("About to run line #109: r.Time(2013, r.July, 29, 23).ToEpochTime()") 599 600 runAndAssert(suite.Suite, expected_, r.Time(2013, r.July, 29, 23).ToEpochTime(), suite.session, r.RunOpts{ 601 GeometryFormat: "raw", 602 GroupFormat: "map", 603 }) 604 suite.T().Log("Finished running line #109") 605 } 606 607 { 608 // times/api.yaml line #111 609 /* 1375081200 */ 610 var expected_ int = 1375081200 611 /* r.time(2013, r.july, 29, "-07:00").to_epoch_time() */ 612 613 suite.T().Log("About to run line #111: r.Time(2013, r.July, 29, '-07:00').ToEpochTime()") 614 615 runAndAssert(suite.Suite, expected_, r.Time(2013, r.July, 29, "-07:00").ToEpochTime(), suite.session, r.RunOpts{ 616 GeometryFormat: "raw", 617 GroupFormat: "map", 618 }) 619 suite.T().Log("Finished running line #111") 620 } 621 622 { 623 // times/api.yaml line #113 624 /* ("-07:00") */ 625 var expected_ string = "-07:00" 626 /* r.time(2013, r.july, 29, "-07:00").timezone() */ 627 628 suite.T().Log("About to run line #113: r.Time(2013, r.July, 29, '-07:00').Timezone()") 629 630 runAndAssert(suite.Suite, expected_, r.Time(2013, r.July, 29, "-07:00").Timezone(), suite.session, r.RunOpts{ 631 GeometryFormat: "raw", 632 GroupFormat: "map", 633 }) 634 suite.T().Log("Finished running line #113") 635 } 636 637 { 638 // times/api.yaml line #119 639 /* 1375242965 */ 640 var expected_ int = 1375242965 641 /* r.iso8601("2013-07-30T20:56:05-07:00").to_epoch_time() */ 642 643 suite.T().Log("About to run line #119: r.ISO8601('2013-07-30T20:56:05-07:00').ToEpochTime()") 644 645 runAndAssert(suite.Suite, expected_, r.ISO8601("2013-07-30T20:56:05-07:00").ToEpochTime(), suite.session, r.RunOpts{ 646 GeometryFormat: "raw", 647 GroupFormat: "map", 648 }) 649 suite.T().Log("Finished running line #119") 650 } 651 652 { 653 // times/api.yaml line #122 654 /* ("2013-07-30T20:56:05-07:00") */ 655 var expected_ string = "2013-07-30T20:56:05-07:00" 656 /* r.epoch_time(1375242965).in_timezone("-07:00").to_iso8601() */ 657 658 suite.T().Log("About to run line #122: r.EpochTime(1375242965).InTimezone('-07:00').ToISO8601()") 659 660 runAndAssert(suite.Suite, expected_, r.EpochTime(1375242965).InTimezone("-07:00").ToISO8601(), suite.session, r.RunOpts{ 661 GeometryFormat: "raw", 662 GroupFormat: "map", 663 }) 664 suite.T().Log("Finished running line #122") 665 } 666 667 { 668 // times/api.yaml line #125 669 /* ("PTYPE<TIME>") */ 670 var expected_ string = "PTYPE<TIME>" 671 /* r.now().type_of() */ 672 673 suite.T().Log("About to run line #125: r.Now().TypeOf()") 674 675 runAndAssert(suite.Suite, expected_, r.Now().TypeOf(), suite.session, r.RunOpts{ 676 GeometryFormat: "raw", 677 GroupFormat: "map", 678 }) 679 suite.T().Log("Finished running line #125") 680 } 681 682 { 683 // times/api.yaml line #127 684 /* 0 */ 685 var expected_ int = 0 686 /* (r.now() - r.now()) */ 687 688 suite.T().Log("About to run line #127: r.Now().Sub(r.Now())") 689 690 runAndAssert(suite.Suite, expected_, r.Now().Sub(r.Now()), suite.session, r.RunOpts{ 691 GeometryFormat: "raw", 692 GroupFormat: "map", 693 }) 694 suite.T().Log("Finished running line #127") 695 } 696 697 { 698 // times/api.yaml line #132 699 /* err("ReqlQueryLogicError", "ISO 8601 string has no time zone, and no default time zone was provided.", []) */ 700 var expected_ Err = err("ReqlQueryLogicError", "ISO 8601 string has no time zone, and no default time zone was provided.") 701 /* r.iso8601("2013-07-30T20:56:05").to_iso8601() */ 702 703 suite.T().Log("About to run line #132: r.ISO8601('2013-07-30T20:56:05').ToISO8601()") 704 705 runAndAssert(suite.Suite, expected_, r.ISO8601("2013-07-30T20:56:05").ToISO8601(), suite.session, r.RunOpts{ 706 GeometryFormat: "raw", 707 GroupFormat: "map", 708 }) 709 suite.T().Log("Finished running line #132") 710 } 711 712 { 713 // times/api.yaml line #136 714 /* ("2013-07-30T20:56:05-07:00") */ 715 var expected_ string = "2013-07-30T20:56:05-07:00" 716 /* r.iso8601("2013-07-30T20:56:05", default_timezone='-07').to_iso8601() */ 717 718 suite.T().Log("About to run line #136: r.ISO8601('2013-07-30T20:56:05').OptArgs(r.ISO8601Opts{DefaultTimezone: '-07', }).ToISO8601()") 719 720 runAndAssert(suite.Suite, expected_, r.ISO8601("2013-07-30T20:56:05").OptArgs(r.ISO8601Opts{DefaultTimezone: "-07"}).ToISO8601(), suite.session, r.RunOpts{ 721 GeometryFormat: "raw", 722 GroupFormat: "map", 723 }) 724 suite.T().Log("Finished running line #136") 725 } 726 727 { 728 // times/api.yaml line #140 729 /* ([1, 2, 3, 4, 5, 6, 7]) */ 730 var expected_ []interface{} = []interface{}{1, 2, 3, 4, 5, 6, 7} 731 /* r.expr([r.monday, r.tuesday, r.wednesday, r.thursday, r.friday, r.saturday, r.sunday]) */ 732 733 suite.T().Log("About to run line #140: r.Expr([]interface{}{r.Monday, r.Tuesday, r.Wednesday, r.Thursday, r.Friday, r.Saturday, r.Sunday})") 734 735 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{r.Monday, r.Tuesday, r.Wednesday, r.Thursday, r.Friday, r.Saturday, r.Sunday}), suite.session, r.RunOpts{ 736 GeometryFormat: "raw", 737 GroupFormat: "map", 738 }) 739 suite.T().Log("Finished running line #140") 740 } 741 742 { 743 // times/api.yaml line #142 744 /* ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) */ 745 var expected_ []interface{} = []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} 746 /* r.expr([r.january, r.february, r.march, r.april, r.may, r.june, 747 r.july, r.august, r.september, r.october, r.november, r.december]) */ 748 749 suite.T().Log("About to run line #142: r.Expr([]interface{}{r.January, r.February, r.March, r.April, r.May, r.June, r.July, r.August, r.September, r.October, r.November, r.December})") 750 751 runAndAssert(suite.Suite, expected_, r.Expr([]interface{}{r.January, r.February, r.March, r.April, r.May, r.June, r.July, r.August, r.September, r.October, r.November, r.December}), suite.session, r.RunOpts{ 752 GeometryFormat: "raw", 753 GroupFormat: "map", 754 }) 755 suite.T().Log("Finished running line #142") 756 } 757 }