|
| 1 | +// |
| 2 | +// Test.swift |
| 3 | +// RectangleTools |
| 4 | +// |
| 5 | +// Created by Ky on 2024-08-05. |
| 6 | +// |
| 7 | + |
| 8 | +import Testing |
| 9 | + |
| 10 | +import RectangleTools |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +struct InversionTests { |
| 15 | + |
| 16 | + @Test func twoDimensional() async throws { |
| 17 | + #expect(.init(width: -4, height: -8) == -TestSizes.intSize__4_8) |
| 18 | + #expect(.init(width: -3, height: -4) == -TestSizes.intSize__3_4) |
| 19 | + #expect(.init(width: 3, height: -4) == -TestSizes.intSize__n3_4) |
| 20 | + #expect(.init(width: -3, height: 4) == -TestSizes.intSize__3_n4) |
| 21 | + |
| 22 | + // #expect(.init(width: -4, height: -8) == -TestSizes.uIntSize__4_8) 🛑 Cannot compile because UInt can't be negated |
| 23 | + // #expect(.init(width: -3, height: -4) == -TestSizes.uIntSize__3_4) 🛑 Cannot compile because UInt can't be negated |
| 24 | + |
| 25 | + #expect(.init(width: -4, height: -8) == -TestSizes.cgSize__4_8) |
| 26 | + #expect(.init(width: -3, height: -4) == -TestSizes.cgSize__3_4) |
| 27 | + #expect(.init(width: 3, height: -4) == -TestSizes.cgSize__n3_4) |
| 28 | + #expect(.init(width: -3, height: 4) == -TestSizes.cgSize__3_n4) |
| 29 | + |
| 30 | + #expect(.init(width: -4, height: -8) == -TestSizes.decimalSize__4_8) |
| 31 | + #expect(.init(width: -3, height: -4) == -TestSizes.decimalSize__3_4) |
| 32 | + #expect(.init(width: 3, height: -4) == -TestSizes.decimalSize__n3_4) |
| 33 | + #expect(.init(width: -3, height: 4) == -TestSizes.decimalSize__3_n4) |
| 34 | + |
| 35 | + |
| 36 | + #expect(.init(x: -4, y: -8) == -TestPoints.intPoint__4_8) |
| 37 | + #expect(.init(x: -3, y: -4) == -TestPoints.intPoint__3_4) |
| 38 | + #expect(.init(x: 3, y: -4) == -TestPoints.intPoint__n3_4) |
| 39 | + #expect(.init(x: -3, y: 4) == -TestPoints.intPoint__3_n4) |
| 40 | + |
| 41 | + // #expect(.init(x: -4, y: -8) == -TestPoints.uIntPoint__4_8) 🛑 Cannot compile because UInt can't be negated |
| 42 | + // #expect(.init(x: -3, y: -4) == -TestPoints.uIntPoint__3_4) 🛑 Cannot compile because UInt can't be negated |
| 43 | + |
| 44 | + #expect(.init(x: -4, y: -8) == -TestPoints.cgPoint__4_8) |
| 45 | + #expect(.init(x: -3, y: -4) == -TestPoints.cgPoint__3_4) |
| 46 | + #expect(.init(x: 3, y: -4) == -TestPoints.cgPoint__n3_4) |
| 47 | + #expect(.init(x: -3, y: 4) == -TestPoints.cgPoint__3_n4) |
| 48 | + |
| 49 | + #expect(.init(x: -4, y: -8) == -TestPoints.decimalPoint__4_8) |
| 50 | + #expect(.init(x: -3, y: -4) == -TestPoints.decimalPoint__3_4) |
| 51 | + #expect(.init(x: 3, y: -4) == -TestPoints.decimalPoint__n3_4) |
| 52 | + #expect(.init(x: -3, y: 4) == -TestPoints.decimalPoint__3_n4) |
| 53 | + } |
| 54 | +} |
0 commit comments