package com.hubspot.jinjava.lib.fn;

import static org.assertj.core.api.Assertions.assertThat;

import java.time.ZonedDateTime;

import org.junit.Test;

public class UnixTimestampFunctionTest {

  private final ZonedDateTime d = ZonedDateTime.parse("2013-11-06T14:22:00.000+00:00[UTC]");
  private final long epochMilliseconds = d.toEpochSecond() * 1000;

  @Test
  public void itGetsUnixTimestamps() {
    assertThat(Functions.unixtimestamp(epochMilliseconds)).isEqualTo(epochMilliseconds);
    assertThat(Functions.unixtimestamp(d)).isEqualTo(epochMilliseconds);
    assertThat(Functions.unixtimestamp(null)).isEqualTo(ZonedDateTime.now().toEpochSecond() * 1000);
  }

}

@@ -565,32 +565,41 @@
 %0A    assertThat(
+Math.abs(
 Functions.unixti
@@ -611,28 +611,19 @@
 mp(null)
-).isEqualTo(
+ - 
 ZonedDat
@@ -657,16 +657,32 @@
  * 1000)
+).isLessThan(10)
 ;%0A  %7D%0A%0A%7D

Fix test.