Skip to content

Commit

Permalink
fix test?
Browse files Browse the repository at this point in the history
  • Loading branch information
wegendt-bosch committed Nov 25, 2019
1 parent a4f4ee3 commit 492fbf5
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ class EpochTimeTest extends AbstractRuntimeTest {
val executable = projectPath.resolve(Paths.get("src-gen", "build", "app"));
val lines = runAtMost(executable, 60);
val lastLine = lines.iterator.last;
val timeFromApp = Integer.parseInt(lastLine);
val timeFromJava = Instant.now().toEpochMilli();
val timeFromApp = Integer.parseInt(lastLine).intValue;
val timeFromJava = Instant.now().toEpochMilli() as int;
println('''java: «timeFromJava», testling: «timeFromApp»''')
Assert.assertTrue(Math.abs(timeFromJava as int - timeFromApp) < 10);
// time difference should be less than 2s
Assert.assertTrue(Math.abs(timeFromJava - timeFromApp) < 2000);
}
}

0 comments on commit 492fbf5

Please sign in to comment.