Files
NetNewsWire/Modules/RSCore/Tests/RSCoreTests/GeometryTests.swift
T

20 lines
498 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// GeometryTests.swift
// RSCoreTests
//
// Created by Brent Simmons on 11/5/26.
//
import CoreGraphics
import Testing
import RSCore
@Suite struct GeometryTests {
@Test func aspectFitRectCentersALandscapeImageInAWiderRect() {
// A large thumbnail’s rect and a 3:2 image: 180 tall, 270 wide, centered.
let rect = CGRect(x: 20, y: 40, width: 400, height: 180)
#expect(rect.aspectFitRect(for: CGSize(width: 1500, height: 1000)) == CGRect(x: 85, y: 40, width: 270, height: 180))
}
}