Skip to content

Commit 14dfe28

Browse files
committed
disable test_currencyAccountingMinimumIntegerDigits & test_currencyISOCodeMinimumIntegerDigits
test_currencyAccountingMinimumIntegerDigits does not work with Ubuntu 14.04's libICU and therefore we can't run it in CI. This will be fixed with Swift 5 because Swift 5 vendors libICU which is the right solution but too big of a change for Swift 4.2. test_currencyISOCodeMinimumIntegerDigits has to be disabled too even though the code does not crash on Swift 4.2.3 on Ubuntu 14.04. The reason is that commit 3290d07 corrects the NumberFormatting styles. Previously, currencyISOCode used to map to `7` which is incorrect. Now it correctly maps to `8` but unfortunately that is unsupported by 14.04's libICU...
1 parent 411651b commit 14dfe28

File tree

1 file changed

+0
-48
lines changed

1 file changed

+0
-48
lines changed

TestFoundation/TestNumberFormatter.swift

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ class TestNumberFormatter: XCTestCase {
3030
("test_scientificMinimumIntegerDigits", test_scientificMinimumIntegerDigits),
3131
("test_spellOutMinimumIntegerDigits", test_spellOutMinimumIntegerDigits),
3232
("test_ordinalMinimumIntegerDigits", test_ordinalMinimumIntegerDigits),
33-
("test_currencyISOCodeMinimumIntegerDigits", test_currencyISOCodeMinimumIntegerDigits),
34-
("test_currencyAccountingMinimumIntegerDigits", test_currencyAccountingMinimumIntegerDigits),
3533
("test_maximumIntegerDigits", test_maximumIntegerDigits),
3634
("test_minimumFractionDigits", test_minimumFractionDigits),
3735
("test_maximumFractionDigits", test_maximumFractionDigits),
@@ -345,52 +343,6 @@ class TestNumberFormatter: XCTestCase {
345343
XCTAssertEqual(formatter2.string(from: 42), "42nd")
346344
}
347345

348-
func test_currencyISOCodeMinimumIntegerDigits() {
349-
// If .minimumIntegerDigits is set to 0 before .numberStyle change, preserve the value
350-
let formatter = NumberFormatter()
351-
XCTAssertEqual(formatter.minimumIntegerDigits, 0)
352-
formatter.minimumIntegerDigits = 0
353-
formatter.numberStyle = .currencyISOCode
354-
XCTAssertEqual(formatter.minimumIntegerDigits, 0)
355-
formatter.locale = Locale(identifier: "en_US")
356-
XCTAssertEqual(formatter.string(from: 0), "USD.00")
357-
XCTAssertEqual(formatter.string(from: 1.23), "USD1.23")
358-
XCTAssertEqual(formatter.string(from: 123.4), "USD123.40")
359-
360-
// If .minimumIntegerDigits is not set before .numberStyle change, update the value
361-
let formatter2 = NumberFormatter()
362-
XCTAssertEqual(formatter2.minimumIntegerDigits, 0)
363-
formatter2.numberStyle = .currencyISOCode
364-
XCTAssertEqual(formatter2.minimumIntegerDigits, 1)
365-
formatter2.locale = Locale(identifier: "en_US")
366-
XCTAssertEqual(formatter2.string(from: 0.01), "USD0.01")
367-
XCTAssertEqual(formatter2.string(from: 1.234), "USD1.23")
368-
XCTAssertEqual(formatter2.string(from: 123456.7), "USD123,456.70")
369-
}
370-
371-
func test_currencyAccountingMinimumIntegerDigits() {
372-
// If .minimumIntegerDigits is set to 0 before .numberStyle change, preserve the value
373-
let formatter = NumberFormatter()
374-
XCTAssertEqual(formatter.minimumIntegerDigits, 0)
375-
formatter.minimumIntegerDigits = 0
376-
formatter.numberStyle = .currencyAccounting
377-
XCTAssertEqual(formatter.minimumIntegerDigits, 0)
378-
formatter.locale = Locale(identifier: "en_US")
379-
XCTAssertEqual(formatter.string(from: 0), "$.00")
380-
XCTAssertEqual(formatter.string(from: 1.23), "$1.23")
381-
XCTAssertEqual(formatter.string(from: 123.4), "$123.40")
382-
383-
// If .minimumIntegerDigits is not set before .numberStyle change, update the value
384-
let formatter2 = NumberFormatter()
385-
XCTAssertEqual(formatter2.minimumIntegerDigits, 0)
386-
formatter2.numberStyle = .currencyAccounting
387-
XCTAssertEqual(formatter2.minimumIntegerDigits, 1)
388-
formatter2.locale = Locale(identifier: "en_US")
389-
XCTAssertEqual(formatter2.string(from: 0), "$0.00")
390-
XCTAssertEqual(formatter2.string(from: 1.23), "$1.23")
391-
XCTAssertEqual(formatter2.string(from: 123.4), "$123.40")
392-
}
393-
394346
func test_maximumIntegerDigits() {
395347
let numberFormatter = NumberFormatter()
396348
numberFormatter.maximumIntegerDigits = 3

0 commit comments

Comments
 (0)