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

UnitVolume tests fail on Linux #25

Open
ole opened this issue Nov 7, 2019 · 1 comment
Open

UnitVolume tests fail on Linux #25

ole opened this issue Nov 7, 2019 · 1 comment

Comments

@ole
Copy link
Owner

ole commented Nov 7, 2019

This test fails on Linux:

    func testWithNonBaseUnits() {
        let factor1 = Measurement(value: 100, unit: UnitArea.squareCentimeters)
        let factor2 = Measurement(value: 10, unit: UnitLength.millimeters)
        let actual: Measurement<UnitVolume> = factor1 * factor2
        let expected = Measurement(value: 100, unit: UnitVolume.cubicCentimeters)
        AmpereTest.assertEqual(actual, expected)
    }

XCTAssertEqual failed: ("0.0001 m³") is not equal to ("0.001 m³") - "0.0001 m³" is not equal to "100.0 cm³"

This is due to a bug in swift-corelibs-foundation. Some of the conversion coefficients for UnitVolume are wrong.

@ole
Copy link
Owner Author

ole commented Nov 12, 2019

Reported to bugs.swift.org: SR-11766.

PR: swiftlang/swift-corelibs-foundation#2561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant