Skip to content

Commit

Permalink
Merge pull request #48 from JuliaTime/JeffreySarnoff-patch-2
Browse files Browse the repository at this point in the history
test fix #45
  • Loading branch information
JeffreySarnoff authored Aug 12, 2024
2 parents 77886b9 + 9eb780f commit 7714ce6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/strings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,15 @@ end
@test NanoDate("2022-04-28 02:15:30.1234") == NanoDate("2022-04-28T02:15:30.1234")
end

@testset "parse subseconds" begin
@test NanoDate(2022,5,24,18,26,21,900) == NanoDate("2022-05-24T18:26:21.9")
@test NanoDate(2022,5,24,18,26,21,90) == NanoDate("2022-05-24T18:26:21.09")
@test NanoDate(2022,5,24,18,26,21,9) == NanoDate("2022-05-24T18:26:21.009")
@test NanoDate(2022,5,24,18,26,21,0,900) == NanoDate("2022-05-24T18:26:21.0009")
@test NanoDate(2022,5,24,18,26,21,0,90) == NanoDate("2022-05-24T18:26:21.00009")
@test NanoDate(2022,5,24,18,26,21,0,9) == NanoDate("2022-05-24T18:26:21.000009")
@test NanoDate(2022,5,24,18,26,21,0,0,900) == NanoDate("2022-05-24T18:26:21.0000009")
@test NanoDate(2022,5,24,18,26,21,0,0,90) == NanoDate("2022-05-24T18:26:21.00000009")
@test NanoDate(2022,5,24,18,26,21,0,0,9) == NanoDate("2022-05-24T18:26:21.000000009")
end

0 comments on commit 7714ce6

Please sign in to comment.