desc: Test basic time arithmetic tests: - def: rt1 = 1375147296.681 - def: rt2 = 1375147296.682 - def: rt3 = 1375147297.681 - def: rt4 = 2375147296.681 - def: rts = [rt1, rt2, rt3, rt4] - def: t1 = r.epoch_time(rt1) - def: t2 = r.epoch_time(rt2) - def: t3 = r.epoch_time(rt3) - def: t4 = r.epoch_time(rt4) - def: ts = r.expr([t1, t2, t3, t4]) # We run into double precision with the first one - rb: ((t2 - t1) * 1000).do{|x| (x > 0.99) & (x < 1.01)} py: ((t2 - t1) * 1000).do(lambda x:(x > 0.99) & (x < 1.01)) js: t2.sub(t1).mul(1000).do(r.row.gt(0.99).and(r.row.lt(1.01))) ot: true - cd: t3 - t1 js: t3.sub(t1) ot: 1 - cd: t4 - t1 js: t4.sub(t1) ot: 1000000000 - rb: ((t1 - t2) * 1000).do{|x| (x < -0.99) & (x > -1.01)} py: ((t1 - t2) * 1000).do(lambda x:(x < -0.99) & (x > -1.01)) js: t1.sub(t2).mul(1000).do(r.row.lt(-0.99).and(r.row.gt(-1.01))) ot: true - cd: t1 - t3 js: t1.sub(t3) ot: -1 - cd: t1 - t4 js: t1.sub(t4) ot: -1000000000 - rb: ts.map{|x| t1 + (x - t1)}.map{|x| x.to_epoch_time} py: ts.map(lambda x:t1 + (x - t1)).map(lambda x:x.to_epoch_time()) js: ts.map(t1.add(r.row.sub(t1))).map(r.row.toEpochTime()) ot: ([rt1, rt2, rt3, rt4]) - rb: ts.map{|x| (t1 + x) - t1}.map{|x| x.to_epoch_time} py: ts.map(lambda x:(t1 + x) - t1).map(lambda x:x.to_epoch_time()) js: ts.map(t1.add(r.row).sub(t1)).map(r.row.toEpochTime()) ot: err("ReqlQueryLogicError", "Expected type NUMBER but found PTYPE