1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-15 14:50:32 +05:30
yattee/Tests macOS/Extensions/Int+FormatTests.swift

21 lines
511 B
Swift
Raw Normal View History

import XCTest
final class IntFormatTests: XCTestCase {
func testFormattedAsAbbreviation() throws {
let samples: [Int: String] = [
1: "1",
999: "999",
1000: "1K",
1101: "1,1K",
12345: "12,3K",
123_456: "123,5K",
2021-11-12 02:37:13 +05:30
123_626_789: "123,6M",
1_331_211_123: "1,3B"
]
samples.forEach { value, formatted in
XCTAssertEqual(value.formattedAsAbbreviation(), formatted)
}
}
}