Skip to content

Commit

Permalink
Merge pull request #360 from serhiiz/master
Browse files Browse the repository at this point in the history
Fix KiB/Mib/Gib definitions in the File module
  • Loading branch information
haf committed Dec 19, 2018
2 parents ec72383 + 75993c8 commit b1382e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/Logary.Tests/CoreTarget.fs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ module Files =
acks.Add ack
Job.conIgnore acks)
}

testList "quantities" [
testCase "1 KiB is 1024 B" <| fun _ ->
Expect.isTrue (KiB 1L = B 1024L) "1 KiB should be equal 1024 B"
testCase "1 MiB is 1024 KiB" <| fun _ ->
Expect.isTrue (MiB 1L = KiB 1024L) "1 MiB should be equal 1024 KiB"
testCase "1 GiB is 1024 MiB" <| fun _ ->
Expect.isTrue (GiB 1L = MiB 1024L) "1 GiB should be equal 1024 MiB"
]
]

let tests = [
Expand Down
6 changes: 3 additions & 3 deletions src/Logary/Targets/Core.fs
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,11 @@ module File =
/// Bytes
let B (n: int64) = n
/// Kilobytes
let KiB n = n * 1024L * 1024L
let KiB n = n * 1024L
/// Megabytes
let MiB n = n * 1024L * 1024L * 1024L
let MiB n = n * 1024L * 1024L
/// Gigabytes
let GiB n = n * 1024L * 1024L * 1024L * 1024L
let GiB n = n * 1024L * 1024L * 1024L

/// These are the available rotation policies
type RotationPolicy =
Expand Down

0 comments on commit b1382e1

Please sign in to comment.