Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

current_time() returns different formats when frozen #3

Open
iboard opened this issue Feb 24, 2019 · 0 comments
Open

current_time() returns different formats when frozen #3

iboard opened this issue Feb 24, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@iboard
Copy link
Owner

iboard commented Feb 24, 2019

The bug is

as you can see in this example, that the function current_time()
returns two different formats.
when it is frozen, it returns a NaiveDateTime where it returns
seconds since the epoche when unfrozen.

  test "use the default timer" do
    freeze_time(:default_timer, ~N[1964-08-31 06:00:00])
    :timer.sleep(1010)
    assert ~N[1964-08-31 06:00:00] == current_time() 
    unfreeze_time()
    assert current_time() > 1_000_000_000
   end

Expected behavior
The function should return seconds in any case.

@iboard iboard added the bug Something isn't working label Feb 24, 2019
@iboard iboard added this to Grooming in HEX Packages via automation Feb 24, 2019
@iboard iboard moved this from Grooming to To do in HEX Packages Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
HEX Packages
  
To do
Development

No branches or pull requests

1 participant