| 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 for `floor`, `ceil`, and `round`, tests inspired by the Python test suite |
| 17 | func TestMathLogicFloorCeilRoundSuite(t *testing.T) { |
| 18 | suite.Run(t, new(MathLogicFloorCeilRoundSuite)) |
| 19 | } |
| 20 | |
| 21 | type MathLogicFloorCeilRoundSuite struct { |
| 22 | suite.Suite |
| 23 | |
| 24 | session *r.Session |
| 25 | } |
| 26 | |
| 27 | func (suite *MathLogicFloorCeilRoundSuite) SetupTest() { |
| 28 | suite.T().Log("Setting up MathLogicFloorCeilRoundSuite") |
| 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_logic_floor").Exec(suite.session) |
| 40 | err = r.DBCreate("db_logic_floor").Exec(suite.session) |
| 41 | suite.Require().NoError(err) |
| 42 | err = r.DB("db_logic_floor").Wait().Exec(suite.session) |
| 43 | suite.Require().NoError(err) |
| 44 | |
| 45 | } |
| 46 | |
| 47 | func (suite *MathLogicFloorCeilRoundSuite) TearDownSuite() { |
| 48 | suite.T().Log("Tearing down MathLogicFloorCeilRoundSuite") |
| 49 | |
| 50 | if suite.session != nil { |
| 51 | r.DB("rethinkdb").Table("_debug_scratch").Delete().Exec(suite.session) |
| 52 | r.DBDrop("db_logic_floor").Exec(suite.session) |
| 53 | |
| 54 | suite.session.Close() |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | func (suite *MathLogicFloorCeilRoundSuite) TestCases() { |
| 59 | suite.T().Log("Running MathLogicFloorCeilRoundSuite: tests for `floor`, `ceil`, and `round`, tests inspired by the Python test suite") |
| 60 | |
| 61 | { |
| 62 | // math_logic/floor_ceil_round.yaml line #3 |
| 63 | /* "NUMBER" */ |
| 64 | var expected_ string = "NUMBER" |
| 65 | /* r.floor(1.0).type_of() */ |
| 66 | |
| 67 | suite.T().Log("About to run line #3: r.Floor(1.0).TypeOf()") |
| 68 | |
| 69 | runAndAssert(suite.Suite, expected_, r.Floor(1.0).TypeOf(), suite.session, r.RunOpts{ |
| 70 | GeometryFormat: "raw", |
| 71 | GroupFormat: "map", |
| 72 | }) |
| 73 | suite.T().Log("Finished running line #3") |
| 74 | } |
| 75 | |
| 76 | { |
| 77 | // math_logic/floor_ceil_round.yaml line #5 |
| 78 | /* 1.0 */ |
| 79 | var expected_ float64 = 1.0 |
| 80 | /* r.floor(1.0) */ |
| 81 | |
| 82 | suite.T().Log("About to run line #5: r.Floor(1.0)") |
| 83 | |
| 84 | runAndAssert(suite.Suite, expected_, r.Floor(1.0), suite.session, r.RunOpts{ |
| 85 | GeometryFormat: "raw", |
| 86 | GroupFormat: "map", |
| 87 | }) |
| 88 | suite.T().Log("Finished running line #5") |
| 89 | } |
| 90 | |
| 91 | { |
| 92 | // math_logic/floor_ceil_round.yaml line #7 |
| 93 | /* 1.0 */ |
| 94 | var expected_ float64 = 1.0 |
| 95 | /* r.expr(1.0).floor() */ |
| 96 | |
| 97 | suite.T().Log("About to run line #7: r.Expr(1.0).Floor()") |
| 98 | |
| 99 | runAndAssert(suite.Suite, expected_, r.Expr(1.0).Floor(), suite.session, r.RunOpts{ |
| 100 | GeometryFormat: "raw", |
| 101 | GroupFormat: "map", |
| 102 | }) |
| 103 | suite.T().Log("Finished running line #7") |
| 104 | } |
| 105 | |
| 106 | { |
| 107 | // math_logic/floor_ceil_round.yaml line #10 |
| 108 | /* 0.0 */ |
| 109 | var expected_ float64 = 0.0 |
| 110 | /* r.floor(0.5) */ |
| 111 | |
| 112 | suite.T().Log("About to run line #10: r.Floor(0.5)") |
| 113 | |
| 114 | runAndAssert(suite.Suite, expected_, r.Floor(0.5), suite.session, r.RunOpts{ |
| 115 | GeometryFormat: "raw", |
| 116 | GroupFormat: "map", |
| 117 | }) |
| 118 | suite.T().Log("Finished running line #10") |
| 119 | } |
| 120 | |
| 121 | { |
| 122 | // math_logic/floor_ceil_round.yaml line #12 |
| 123 | /* 1.0 */ |
| 124 | var expected_ float64 = 1.0 |
| 125 | /* r.floor(1.0) */ |
| 126 | |
| 127 | suite.T().Log("About to run line #12: r.Floor(1.0)") |
| 128 | |
| 129 | runAndAssert(suite.Suite, expected_, r.Floor(1.0), suite.session, r.RunOpts{ |
| 130 | GeometryFormat: "raw", |
| 131 | GroupFormat: "map", |
| 132 | }) |
| 133 | suite.T().Log("Finished running line #12") |
| 134 | } |
| 135 | |
| 136 | { |
| 137 | // math_logic/floor_ceil_round.yaml line #14 |
| 138 | /* 1.0 */ |
| 139 | var expected_ float64 = 1.0 |
| 140 | /* r.floor(1.5) */ |
| 141 | |
| 142 | suite.T().Log("About to run line #14: r.Floor(1.5)") |
| 143 | |
| 144 | runAndAssert(suite.Suite, expected_, r.Floor(1.5), suite.session, r.RunOpts{ |
| 145 | GeometryFormat: "raw", |
| 146 | GroupFormat: "map", |
| 147 | }) |
| 148 | suite.T().Log("Finished running line #14") |
| 149 | } |
| 150 | |
| 151 | { |
| 152 | // math_logic/floor_ceil_round.yaml line #16 |
| 153 | /* -1.0 */ |
| 154 | var expected_ float64 = -1.0 |
| 155 | /* r.floor(-0.5) */ |
| 156 | |
| 157 | suite.T().Log("About to run line #16: r.Floor(-0.5)") |
| 158 | |
| 159 | runAndAssert(suite.Suite, expected_, r.Floor(-0.5), suite.session, r.RunOpts{ |
| 160 | GeometryFormat: "raw", |
| 161 | GroupFormat: "map", |
| 162 | }) |
| 163 | suite.T().Log("Finished running line #16") |
| 164 | } |
| 165 | |
| 166 | { |
| 167 | // math_logic/floor_ceil_round.yaml line #18 |
| 168 | /* -1.0 */ |
| 169 | var expected_ float64 = -1.0 |
| 170 | /* r.floor(-1.0) */ |
| 171 | |
| 172 | suite.T().Log("About to run line #18: r.Floor(-1.0)") |
| 173 | |
| 174 | runAndAssert(suite.Suite, expected_, r.Floor(-1.0), suite.session, r.RunOpts{ |
| 175 | GeometryFormat: "raw", |
| 176 | GroupFormat: "map", |
| 177 | }) |
| 178 | suite.T().Log("Finished running line #18") |
| 179 | } |
| 180 | |
| 181 | { |
| 182 | // math_logic/floor_ceil_round.yaml line #20 |
| 183 | /* -2.0 */ |
| 184 | var expected_ float64 = -2.0 |
| 185 | /* r.floor(-1.5) */ |
| 186 | |
| 187 | suite.T().Log("About to run line #20: r.Floor(-1.5)") |
| 188 | |
| 189 | runAndAssert(suite.Suite, expected_, r.Floor(-1.5), suite.session, r.RunOpts{ |
| 190 | GeometryFormat: "raw", |
| 191 | GroupFormat: "map", |
| 192 | }) |
| 193 | suite.T().Log("Finished running line #20") |
| 194 | } |
| 195 | |
| 196 | { |
| 197 | // math_logic/floor_ceil_round.yaml line #23 |
| 198 | /* err("ReqlQueryLogicError", "Expected type NUMBER but found STRING.", []) */ |
| 199 | var expected_ Err = err("ReqlQueryLogicError", "Expected type NUMBER but found STRING.") |
| 200 | /* r.expr('X').floor() */ |
| 201 | |
| 202 | suite.T().Log("About to run line #23: r.Expr('X').Floor()") |
| 203 | |
| 204 | runAndAssert(suite.Suite, expected_, r.Expr("X").Floor(), suite.session, r.RunOpts{ |
| 205 | GeometryFormat: "raw", |
| 206 | GroupFormat: "map", |
| 207 | }) |
| 208 | suite.T().Log("Finished running line #23") |
| 209 | } |
| 210 | |
| 211 | { |
| 212 | // math_logic/floor_ceil_round.yaml line #27 |
| 213 | /* "NUMBER" */ |
| 214 | var expected_ string = "NUMBER" |
| 215 | /* r.ceil(1.0).type_of() */ |
| 216 | |
| 217 | suite.T().Log("About to run line #27: r.Ceil(1.0).TypeOf()") |
| 218 | |
| 219 | runAndAssert(suite.Suite, expected_, r.Ceil(1.0).TypeOf(), suite.session, r.RunOpts{ |
| 220 | GeometryFormat: "raw", |
| 221 | GroupFormat: "map", |
| 222 | }) |
| 223 | suite.T().Log("Finished running line #27") |
| 224 | } |
| 225 | |
| 226 | { |
| 227 | // math_logic/floor_ceil_round.yaml line #29 |
| 228 | /* 1.0 */ |
| 229 | var expected_ float64 = 1.0 |
| 230 | /* r.ceil(1.0) */ |
| 231 | |
| 232 | suite.T().Log("About to run line #29: r.Ceil(1.0)") |
| 233 | |
| 234 | runAndAssert(suite.Suite, expected_, r.Ceil(1.0), suite.session, r.RunOpts{ |
| 235 | GeometryFormat: "raw", |
| 236 | GroupFormat: "map", |
| 237 | }) |
| 238 | suite.T().Log("Finished running line #29") |
| 239 | } |
| 240 | |
| 241 | { |
| 242 | // math_logic/floor_ceil_round.yaml line #31 |
| 243 | /* 1.0 */ |
| 244 | var expected_ float64 = 1.0 |
| 245 | /* r.expr(1.0).ceil() */ |
| 246 | |
| 247 | suite.T().Log("About to run line #31: r.Expr(1.0).Ceil()") |
| 248 | |
| 249 | runAndAssert(suite.Suite, expected_, r.Expr(1.0).Ceil(), suite.session, r.RunOpts{ |
| 250 | GeometryFormat: "raw", |
| 251 | GroupFormat: "map", |
| 252 | }) |
| 253 | suite.T().Log("Finished running line #31") |
| 254 | } |
| 255 | |
| 256 | { |
| 257 | // math_logic/floor_ceil_round.yaml line #34 |
| 258 | /* 1.0 */ |
| 259 | var expected_ float64 = 1.0 |
| 260 | /* r.ceil(0.5) */ |
| 261 | |
| 262 | suite.T().Log("About to run line #34: r.Ceil(0.5)") |
| 263 | |
| 264 | runAndAssert(suite.Suite, expected_, r.Ceil(0.5), suite.session, r.RunOpts{ |
| 265 | GeometryFormat: "raw", |
| 266 | GroupFormat: "map", |
| 267 | }) |
| 268 | suite.T().Log("Finished running line #34") |
| 269 | } |
| 270 | |
| 271 | { |
| 272 | // math_logic/floor_ceil_round.yaml line #36 |
| 273 | /* 1.0 */ |
| 274 | var expected_ float64 = 1.0 |
| 275 | /* r.ceil(1.0) */ |
| 276 | |
| 277 | suite.T().Log("About to run line #36: r.Ceil(1.0)") |
| 278 | |
| 279 | runAndAssert(suite.Suite, expected_, r.Ceil(1.0), suite.session, r.RunOpts{ |
| 280 | GeometryFormat: "raw", |
| 281 | GroupFormat: "map", |
| 282 | }) |
| 283 | suite.T().Log("Finished running line #36") |
| 284 | } |
| 285 | |
| 286 | { |
| 287 | // math_logic/floor_ceil_round.yaml line #38 |
| 288 | /* 2.0 */ |
| 289 | var expected_ float64 = 2.0 |
| 290 | /* r.ceil(1.5) */ |
| 291 | |
| 292 | suite.T().Log("About to run line #38: r.Ceil(1.5)") |
| 293 | |
| 294 | runAndAssert(suite.Suite, expected_, r.Ceil(1.5), suite.session, r.RunOpts{ |
| 295 | GeometryFormat: "raw", |
| 296 | GroupFormat: "map", |
| 297 | }) |
| 298 | suite.T().Log("Finished running line #38") |
| 299 | } |
| 300 | |
| 301 | { |
| 302 | // math_logic/floor_ceil_round.yaml line #40 |
| 303 | /* 0.0 */ |
| 304 | var expected_ float64 = 0.0 |
| 305 | /* r.ceil(-0.5) */ |
| 306 | |
| 307 | suite.T().Log("About to run line #40: r.Ceil(-0.5)") |
| 308 | |
| 309 | runAndAssert(suite.Suite, expected_, r.Ceil(-0.5), suite.session, r.RunOpts{ |
| 310 | GeometryFormat: "raw", |
| 311 | GroupFormat: "map", |
| 312 | }) |
| 313 | suite.T().Log("Finished running line #40") |
| 314 | } |
| 315 | |
| 316 | { |
| 317 | // math_logic/floor_ceil_round.yaml line #42 |
| 318 | /* -1.0 */ |
| 319 | var expected_ float64 = -1.0 |
| 320 | /* r.ceil(-1.0) */ |
| 321 | |
| 322 | suite.T().Log("About to run line #42: r.Ceil(-1.0)") |
| 323 | |
| 324 | runAndAssert(suite.Suite, expected_, r.Ceil(-1.0), suite.session, r.RunOpts{ |
| 325 | GeometryFormat: "raw", |
| 326 | GroupFormat: "map", |
| 327 | }) |
| 328 | suite.T().Log("Finished running line #42") |
| 329 | } |
| 330 | |
| 331 | { |
| 332 | // math_logic/floor_ceil_round.yaml line #44 |
| 333 | /* -1.0 */ |
| 334 | var expected_ float64 = -1.0 |
| 335 | /* r.ceil(-1.5) */ |
| 336 | |
| 337 | suite.T().Log("About to run line #44: r.Ceil(-1.5)") |
| 338 | |
| 339 | runAndAssert(suite.Suite, expected_, r.Ceil(-1.5), suite.session, r.RunOpts{ |
| 340 | GeometryFormat: "raw", |
| 341 | GroupFormat: "map", |
| 342 | }) |
| 343 | suite.T().Log("Finished running line #44") |
| 344 | } |
| 345 | |
| 346 | { |
| 347 | // math_logic/floor_ceil_round.yaml line #47 |
| 348 | /* err("ReqlQueryLogicError", "Expected type NUMBER but found STRING.", []) */ |
| 349 | var expected_ Err = err("ReqlQueryLogicError", "Expected type NUMBER but found STRING.") |
| 350 | /* r.expr('X').ceil() */ |
| 351 | |
| 352 | suite.T().Log("About to run line #47: r.Expr('X').Ceil()") |
| 353 | |
| 354 | runAndAssert(suite.Suite, expected_, r.Expr("X").Ceil(), suite.session, r.RunOpts{ |
| 355 | GeometryFormat: "raw", |
| 356 | GroupFormat: "map", |
| 357 | }) |
| 358 | suite.T().Log("Finished running line #47") |
| 359 | } |
| 360 | |
| 361 | { |
| 362 | // math_logic/floor_ceil_round.yaml line #51 |
| 363 | /* "NUMBER" */ |
| 364 | var expected_ string = "NUMBER" |
| 365 | /* r.round(1.0).type_of() */ |
| 366 | |
| 367 | suite.T().Log("About to run line #51: r.Round(1.0).TypeOf()") |
| 368 | |
| 369 | runAndAssert(suite.Suite, expected_, r.Round(1.0).TypeOf(), suite.session, r.RunOpts{ |
| 370 | GeometryFormat: "raw", |
| 371 | GroupFormat: "map", |
| 372 | }) |
| 373 | suite.T().Log("Finished running line #51") |
| 374 | } |
| 375 | |
| 376 | { |
| 377 | // math_logic/floor_ceil_round.yaml line #53 |
| 378 | /* 1.0 */ |
| 379 | var expected_ float64 = 1.0 |
| 380 | /* r.round(1.0) */ |
| 381 | |
| 382 | suite.T().Log("About to run line #53: r.Round(1.0)") |
| 383 | |
| 384 | runAndAssert(suite.Suite, expected_, r.Round(1.0), suite.session, r.RunOpts{ |
| 385 | GeometryFormat: "raw", |
| 386 | GroupFormat: "map", |
| 387 | }) |
| 388 | suite.T().Log("Finished running line #53") |
| 389 | } |
| 390 | |
| 391 | { |
| 392 | // math_logic/floor_ceil_round.yaml line #55 |
| 393 | /* 1.0 */ |
| 394 | var expected_ float64 = 1.0 |
| 395 | /* r.expr(1.0).round() */ |
| 396 | |
| 397 | suite.T().Log("About to run line #55: r.Expr(1.0).Round()") |
| 398 | |
| 399 | runAndAssert(suite.Suite, expected_, r.Expr(1.0).Round(), suite.session, r.RunOpts{ |
| 400 | GeometryFormat: "raw", |
| 401 | GroupFormat: "map", |
| 402 | }) |
| 403 | suite.T().Log("Finished running line #55") |
| 404 | } |
| 405 | |
| 406 | { |
| 407 | // math_logic/floor_ceil_round.yaml line #58 |
| 408 | /* 1.0 */ |
| 409 | var expected_ float64 = 1.0 |
| 410 | /* r.round(0.5) */ |
| 411 | |
| 412 | suite.T().Log("About to run line #58: r.Round(0.5)") |
| 413 | |
| 414 | runAndAssert(suite.Suite, expected_, r.Round(0.5), suite.session, r.RunOpts{ |
| 415 | GeometryFormat: "raw", |
| 416 | GroupFormat: "map", |
| 417 | }) |
| 418 | suite.T().Log("Finished running line #58") |
| 419 | } |
| 420 | |
| 421 | { |
| 422 | // math_logic/floor_ceil_round.yaml line #60 |
| 423 | /* -1.0 */ |
| 424 | var expected_ float64 = -1.0 |
| 425 | /* r.round(-0.5) */ |
| 426 | |
| 427 | suite.T().Log("About to run line #60: r.Round(-0.5)") |
| 428 | |
| 429 | runAndAssert(suite.Suite, expected_, r.Round(-0.5), suite.session, r.RunOpts{ |
| 430 | GeometryFormat: "raw", |
| 431 | GroupFormat: "map", |
| 432 | }) |
| 433 | suite.T().Log("Finished running line #60") |
| 434 | } |
| 435 | |
| 436 | { |
| 437 | // math_logic/floor_ceil_round.yaml line #63 |
| 438 | /* 0.0 */ |
| 439 | var expected_ float64 = 0.0 |
| 440 | /* r.round(0.0) */ |
| 441 | |
| 442 | suite.T().Log("About to run line #63: r.Round(0.0)") |
| 443 | |
| 444 | runAndAssert(suite.Suite, expected_, r.Round(0.0), suite.session, r.RunOpts{ |
| 445 | GeometryFormat: "raw", |
| 446 | GroupFormat: "map", |
| 447 | }) |
| 448 | suite.T().Log("Finished running line #63") |
| 449 | } |
| 450 | |
| 451 | { |
| 452 | // math_logic/floor_ceil_round.yaml line #65 |
| 453 | /* 1.0 */ |
| 454 | var expected_ float64 = 1.0 |
| 455 | /* r.round(1.0) */ |
| 456 | |
| 457 | suite.T().Log("About to run line #65: r.Round(1.0)") |
| 458 | |
| 459 | runAndAssert(suite.Suite, expected_, r.Round(1.0), suite.session, r.RunOpts{ |
| 460 | GeometryFormat: "raw", |
| 461 | GroupFormat: "map", |
| 462 | }) |
| 463 | suite.T().Log("Finished running line #65") |
| 464 | } |
| 465 | |
| 466 | { |
| 467 | // math_logic/floor_ceil_round.yaml line #67 |
| 468 | /* 10.0 */ |
| 469 | var expected_ float64 = 10.0 |
| 470 | /* r.round(10.0) */ |
| 471 | |
| 472 | suite.T().Log("About to run line #67: r.Round(10.0)") |
| 473 | |
| 474 | runAndAssert(suite.Suite, expected_, r.Round(10.0), suite.session, r.RunOpts{ |
| 475 | GeometryFormat: "raw", |
| 476 | GroupFormat: "map", |
| 477 | }) |
| 478 | suite.T().Log("Finished running line #67") |
| 479 | } |
| 480 | |
| 481 | { |
| 482 | // math_logic/floor_ceil_round.yaml line #69 |
| 483 | /* 1000000000.0 */ |
| 484 | var expected_ float64 = 1000000000.0 |
| 485 | /* r.round(1000000000.0) */ |
| 486 | |
| 487 | suite.T().Log("About to run line #69: r.Round(1000000000.0)") |
| 488 | |
| 489 | runAndAssert(suite.Suite, expected_, r.Round(1000000000.0), suite.session, r.RunOpts{ |
| 490 | GeometryFormat: "raw", |
| 491 | GroupFormat: "map", |
| 492 | }) |
| 493 | suite.T().Log("Finished running line #69") |
| 494 | } |
| 495 | |
| 496 | { |
| 497 | // math_logic/floor_ceil_round.yaml line #71 |
| 498 | /* 1e20 */ |
| 499 | var expected_ float64 = 1e+20 |
| 500 | /* r.round(1e20) */ |
| 501 | |
| 502 | suite.T().Log("About to run line #71: r.Round(1e+20)") |
| 503 | |
| 504 | runAndAssert(suite.Suite, expected_, r.Round(1e+20), suite.session, r.RunOpts{ |
| 505 | GeometryFormat: "raw", |
| 506 | GroupFormat: "map", |
| 507 | }) |
| 508 | suite.T().Log("Finished running line #71") |
| 509 | } |
| 510 | |
| 511 | { |
| 512 | // math_logic/floor_ceil_round.yaml line #74 |
| 513 | /* -1.0 */ |
| 514 | var expected_ float64 = -1.0 |
| 515 | /* r.round(-1.0) */ |
| 516 | |
| 517 | suite.T().Log("About to run line #74: r.Round(-1.0)") |
| 518 | |
| 519 | runAndAssert(suite.Suite, expected_, r.Round(-1.0), suite.session, r.RunOpts{ |
| 520 | GeometryFormat: "raw", |
| 521 | GroupFormat: "map", |
| 522 | }) |
| 523 | suite.T().Log("Finished running line #74") |
| 524 | } |
| 525 | |
| 526 | { |
| 527 | // math_logic/floor_ceil_round.yaml line #76 |
| 528 | /* -10.0 */ |
| 529 | var expected_ float64 = -10.0 |
| 530 | /* r.round(-10.0) */ |
| 531 | |
| 532 | suite.T().Log("About to run line #76: r.Round(-10.0)") |
| 533 | |
| 534 | runAndAssert(suite.Suite, expected_, r.Round(-10.0), suite.session, r.RunOpts{ |
| 535 | GeometryFormat: "raw", |
| 536 | GroupFormat: "map", |
| 537 | }) |
| 538 | suite.T().Log("Finished running line #76") |
| 539 | } |
| 540 | |
| 541 | { |
| 542 | // math_logic/floor_ceil_round.yaml line #78 |
| 543 | /* -1000000000.0 */ |
| 544 | var expected_ float64 = -1000000000.0 |
| 545 | /* r.round(-1000000000.0) */ |
| 546 | |
| 547 | suite.T().Log("About to run line #78: r.Round(-1000000000.0)") |
| 548 | |
| 549 | runAndAssert(suite.Suite, expected_, r.Round(-1000000000.0), suite.session, r.RunOpts{ |
| 550 | GeometryFormat: "raw", |
| 551 | GroupFormat: "map", |
| 552 | }) |
| 553 | suite.T().Log("Finished running line #78") |
| 554 | } |
| 555 | |
| 556 | { |
| 557 | // math_logic/floor_ceil_round.yaml line #80 |
| 558 | /* -1e20 */ |
| 559 | var expected_ float64 = -1e+20 |
| 560 | /* r.round(-1e20) */ |
| 561 | |
| 562 | suite.T().Log("About to run line #80: r.Round(-1e+20)") |
| 563 | |
| 564 | runAndAssert(suite.Suite, expected_, r.Round(-1e+20), suite.session, r.RunOpts{ |
| 565 | GeometryFormat: "raw", |
| 566 | GroupFormat: "map", |
| 567 | }) |
| 568 | suite.T().Log("Finished running line #80") |
| 569 | } |
| 570 | |
| 571 | { |
| 572 | // math_logic/floor_ceil_round.yaml line #83 |
| 573 | /* 0.0 */ |
| 574 | var expected_ float64 = 0.0 |
| 575 | /* r.round(0.1) */ |
| 576 | |
| 577 | suite.T().Log("About to run line #83: r.Round(0.1)") |
| 578 | |
| 579 | runAndAssert(suite.Suite, expected_, r.Round(0.1), suite.session, r.RunOpts{ |
| 580 | GeometryFormat: "raw", |
| 581 | GroupFormat: "map", |
| 582 | }) |
| 583 | suite.T().Log("Finished running line #83") |
| 584 | } |
| 585 | |
| 586 | { |
| 587 | // math_logic/floor_ceil_round.yaml line #85 |
| 588 | /* 1.0 */ |
| 589 | var expected_ float64 = 1.0 |
| 590 | /* r.round(1.1) */ |
| 591 | |
| 592 | suite.T().Log("About to run line #85: r.Round(1.1)") |
| 593 | |
| 594 | runAndAssert(suite.Suite, expected_, r.Round(1.1), suite.session, r.RunOpts{ |
| 595 | GeometryFormat: "raw", |
| 596 | GroupFormat: "map", |
| 597 | }) |
| 598 | suite.T().Log("Finished running line #85") |
| 599 | } |
| 600 | |
| 601 | { |
| 602 | // math_logic/floor_ceil_round.yaml line #87 |
| 603 | /* 10.0 */ |
| 604 | var expected_ float64 = 10.0 |
| 605 | /* r.round(10.1) */ |
| 606 | |
| 607 | suite.T().Log("About to run line #87: r.Round(10.1)") |
| 608 | |
| 609 | runAndAssert(suite.Suite, expected_, r.Round(10.1), suite.session, r.RunOpts{ |
| 610 | GeometryFormat: "raw", |
| 611 | GroupFormat: "map", |
| 612 | }) |
| 613 | suite.T().Log("Finished running line #87") |
| 614 | } |
| 615 | |
| 616 | { |
| 617 | // math_logic/floor_ceil_round.yaml line #89 |
| 618 | /* 1000000000.0 */ |
| 619 | var expected_ float64 = 1000000000.0 |
| 620 | /* r.round(1000000000.1) */ |
| 621 | |
| 622 | suite.T().Log("About to run line #89: r.Round(1000000000.1)") |
| 623 | |
| 624 | runAndAssert(suite.Suite, expected_, r.Round(1000000000.1), suite.session, r.RunOpts{ |
| 625 | GeometryFormat: "raw", |
| 626 | GroupFormat: "map", |
| 627 | }) |
| 628 | suite.T().Log("Finished running line #89") |
| 629 | } |
| 630 | |
| 631 | { |
| 632 | // math_logic/floor_ceil_round.yaml line #92 |
| 633 | /* -1.0 */ |
| 634 | var expected_ float64 = -1.0 |
| 635 | /* r.round(-1.1) */ |
| 636 | |
| 637 | suite.T().Log("About to run line #92: r.Round(-1.1)") |
| 638 | |
| 639 | runAndAssert(suite.Suite, expected_, r.Round(-1.1), suite.session, r.RunOpts{ |
| 640 | GeometryFormat: "raw", |
| 641 | GroupFormat: "map", |
| 642 | }) |
| 643 | suite.T().Log("Finished running line #92") |
| 644 | } |
| 645 | |
| 646 | { |
| 647 | // math_logic/floor_ceil_round.yaml line #94 |
| 648 | /* -10.0 */ |
| 649 | var expected_ float64 = -10.0 |
| 650 | /* r.round(-10.1) */ |
| 651 | |
| 652 | suite.T().Log("About to run line #94: r.Round(-10.1)") |
| 653 | |
| 654 | runAndAssert(suite.Suite, expected_, r.Round(-10.1), suite.session, r.RunOpts{ |
| 655 | GeometryFormat: "raw", |
| 656 | GroupFormat: "map", |
| 657 | }) |
| 658 | suite.T().Log("Finished running line #94") |
| 659 | } |
| 660 | |
| 661 | { |
| 662 | // math_logic/floor_ceil_round.yaml line #96 |
| 663 | /* -1000000000.0 */ |
| 664 | var expected_ float64 = -1000000000.0 |
| 665 | /* r.round(-1000000000.1) */ |
| 666 | |
| 667 | suite.T().Log("About to run line #96: r.Round(-1000000000.1)") |
| 668 | |
| 669 | runAndAssert(suite.Suite, expected_, r.Round(-1000000000.1), suite.session, r.RunOpts{ |
| 670 | GeometryFormat: "raw", |
| 671 | GroupFormat: "map", |
| 672 | }) |
| 673 | suite.T().Log("Finished running line #96") |
| 674 | } |
| 675 | |
| 676 | { |
| 677 | // math_logic/floor_ceil_round.yaml line #99 |
| 678 | /* 1.0 */ |
| 679 | var expected_ float64 = 1.0 |
| 680 | /* r.round(0.9) */ |
| 681 | |
| 682 | suite.T().Log("About to run line #99: r.Round(0.9)") |
| 683 | |
| 684 | runAndAssert(suite.Suite, expected_, r.Round(0.9), suite.session, r.RunOpts{ |
| 685 | GeometryFormat: "raw", |
| 686 | GroupFormat: "map", |
| 687 | }) |
| 688 | suite.T().Log("Finished running line #99") |
| 689 | } |
| 690 | |
| 691 | { |
| 692 | // math_logic/floor_ceil_round.yaml line #101 |
| 693 | /* 10.0 */ |
| 694 | var expected_ float64 = 10.0 |
| 695 | /* r.round(9.9) */ |
| 696 | |
| 697 | suite.T().Log("About to run line #101: r.Round(9.9)") |
| 698 | |
| 699 | runAndAssert(suite.Suite, expected_, r.Round(9.9), suite.session, r.RunOpts{ |
| 700 | GeometryFormat: "raw", |
| 701 | GroupFormat: "map", |
| 702 | }) |
| 703 | suite.T().Log("Finished running line #101") |
| 704 | } |
| 705 | |
| 706 | { |
| 707 | // math_logic/floor_ceil_round.yaml line #103 |
| 708 | /* 1000000000.0 */ |
| 709 | var expected_ float64 = 1000000000.0 |
| 710 | /* r.round(999999999.9) */ |
| 711 | |
| 712 | suite.T().Log("About to run line #103: r.Round(999999999.9)") |
| 713 | |
| 714 | runAndAssert(suite.Suite, expected_, r.Round(999999999.9), suite.session, r.RunOpts{ |
| 715 | GeometryFormat: "raw", |
| 716 | GroupFormat: "map", |
| 717 | }) |
| 718 | suite.T().Log("Finished running line #103") |
| 719 | } |
| 720 | |
| 721 | { |
| 722 | // math_logic/floor_ceil_round.yaml line #106 |
| 723 | /* -1.0 */ |
| 724 | var expected_ float64 = -1.0 |
| 725 | /* r.round(-0.9) */ |
| 726 | |
| 727 | suite.T().Log("About to run line #106: r.Round(-0.9)") |
| 728 | |
| 729 | runAndAssert(suite.Suite, expected_, r.Round(-0.9), suite.session, r.RunOpts{ |
| 730 | GeometryFormat: "raw", |
| 731 | GroupFormat: "map", |
| 732 | }) |
| 733 | suite.T().Log("Finished running line #106") |
| 734 | } |
| 735 | |
| 736 | { |
| 737 | // math_logic/floor_ceil_round.yaml line #108 |
| 738 | /* -10.0 */ |
| 739 | var expected_ float64 = -10.0 |
| 740 | /* r.round(-9.9) */ |
| 741 | |
| 742 | suite.T().Log("About to run line #108: r.Round(-9.9)") |
| 743 | |
| 744 | runAndAssert(suite.Suite, expected_, r.Round(-9.9), suite.session, r.RunOpts{ |
| 745 | GeometryFormat: "raw", |
| 746 | GroupFormat: "map", |
| 747 | }) |
| 748 | suite.T().Log("Finished running line #108") |
| 749 | } |
| 750 | |
| 751 | { |
| 752 | // math_logic/floor_ceil_round.yaml line #110 |
| 753 | /* -1000000000.0 */ |
| 754 | var expected_ float64 = -1000000000.0 |
| 755 | /* r.round(-999999999.9) */ |
| 756 | |
| 757 | suite.T().Log("About to run line #110: r.Round(-999999999.9)") |
| 758 | |
| 759 | runAndAssert(suite.Suite, expected_, r.Round(-999999999.9), suite.session, r.RunOpts{ |
| 760 | GeometryFormat: "raw", |
| 761 | GroupFormat: "map", |
| 762 | }) |
| 763 | suite.T().Log("Finished running line #110") |
| 764 | } |
| 765 | |
| 766 | { |
| 767 | // math_logic/floor_ceil_round.yaml line #113 |
| 768 | /* err("ReqlQueryLogicError", "Expected type NUMBER but found STRING.", []) */ |
| 769 | var expected_ Err = err("ReqlQueryLogicError", "Expected type NUMBER but found STRING.") |
| 770 | /* r.expr('X').round() */ |
| 771 | |
| 772 | suite.T().Log("About to run line #113: r.Expr('X').Round()") |
| 773 | |
| 774 | runAndAssert(suite.Suite, expected_, r.Expr("X").Round(), suite.session, r.RunOpts{ |
| 775 | GeometryFormat: "raw", |
| 776 | GroupFormat: "map", |
| 777 | }) |
| 778 | suite.T().Log("Finished running line #113") |
| 779 | } |
| 780 | } |