-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Temp/Reaumur conversion, also looks like power was not yet add, s…
…o now added.
- Loading branch information
1 parent
0f98606
commit a72e921
Showing
7 changed files
with
237 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"image": "swift", | ||
"forwardPorts": [3000] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
If running on Windows, open as devcontainer | ||
|
||
# Build | ||
|
||
swift build | ||
swift test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// <auto-generated> | ||
// This code was generated by the UnitCodeGenerator tool | ||
// | ||
// Changes to this file will be lost if the code is regenerated | ||
// </auto-generated> | ||
|
||
public final class Power { | ||
@available(*, unavailable) private init() {} | ||
|
||
public final class MechanicalHorsePower { | ||
@available(*, unavailable) private init() {} | ||
|
||
public static func toMetricHorsePower(_ value : Double) -> Double { | ||
return value * 1.013869665424; | ||
} | ||
} | ||
|
||
public final class MetricHorsePower { | ||
@available(*, unavailable) private init() {} | ||
|
||
public static func toMechanicalHorsePower(_ value : Double) -> Double { | ||
return value / 1.013869665424; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// <auto-generated> | ||
// This code was generated by the UnitCodeGenerator tool | ||
// | ||
// Changes to this file will be lost if the code is regenerated | ||
// </auto-generated> | ||
|
||
import XCTest | ||
@testable import SwiftUnits | ||
|
||
final class MechanicalHorsePowerTests: XCTestCase { | ||
func testConvertKnownMechanicalHorsePowerToMetricHorsePower_1() throws { | ||
let result = Power.MechanicalHorsePower.toMetricHorsePower(65.0971) | ||
XCTAssertEqual(65.9999749, result, accuracy: 0.01) | ||
} | ||
|
||
func testConvertKnownMechanicalHorsePowerToMetricHorsePower_2() throws { | ||
let result = Power.MechanicalHorsePower.toMetricHorsePower(121.317) | ||
XCTAssertEqual(122.9996, result, accuracy: 0.01) | ||
} | ||
|
||
func testConvertKnownMechanicalHorsePowerToMetricHorsePower_3() throws { | ||
let result = Power.MechanicalHorsePower.toMetricHorsePower(86.7962) | ||
XCTAssertEqual(88.0, result, accuracy: 0.01) | ||
} | ||
|
||
} | ||
|
||
final class MetricHorsePowerTests: XCTestCase { | ||
func testConvertKnownMetricHorsePowerToMechanicalHorsePower_1() throws { | ||
let result = Power.MetricHorsePower.toMechanicalHorsePower(126.734) | ||
XCTAssertEqual(125.0, result, accuracy: 0.01) | ||
} | ||
|
||
func testConvertKnownMetricHorsePowerToMechanicalHorsePower_2() throws { | ||
let result = Power.MetricHorsePower.toMechanicalHorsePower(91.2483) | ||
XCTAssertEqual(90.0, result, accuracy: 0.01) | ||
} | ||
|
||
func testConvertKnownMetricHorsePowerToMechanicalHorsePower_3() throws { | ||
let result = Power.MetricHorsePower.toMechanicalHorsePower(425.825) | ||
XCTAssertEqual(419.9997, result, accuracy: 0.01) | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters