File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Tests/FoundationEssentialsTests Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -200,3 +200,20 @@ final class ProcessInfoTests : XCTestCase {
200
200
XCTAssertNil ( env [ " " ] )
201
201
}
202
202
}
203
+
204
+ // MARK: - ThermalState and PowerState tests
205
+ #if FOUNDATION_FRAMEWORK
206
+ extension ProcessInfoTests {
207
+ func testThermalPowerState( ) {
208
+ // This test simply makes sure we can deliver the correct
209
+ // thermal and power state for all platforms.
210
+ // Fake a new value
211
+ _NSSwiftProcessInfo. _globalState. withLock {
212
+ $0. thermalState = . critical
213
+ $0. powerState = . restricted
214
+ }
215
+ XCTAssertEqual ( ProcessInfo . processInfo. thermalState, . critical)
216
+ XCTAssertEqual ( ProcessInfo . processInfo. isLowPowerModeEnabled, true )
217
+ }
218
+ }
219
+ #endif // FOUDATION_FRAMEWORK
You can’t perform that action at this time.
0 commit comments