         let cdExplicitStrip = "cd".styled(with: .tracking(.point(10)), stripTrailingKerning: true)
         let customStyled = NSAttributedString.composed(of: [abNoStrip, cdExplicitStrip])
 
-        let customRangesToValuesLine = #line; let customRangesToValues: [(NSRange, Double?)] = [
-            (NSRange(location: 0, length: 2), 5),
-            (NSRange(location: 2, length: 1), 10),
-            (NSRange(location: 3, length: 1), nil),
+        let customRangesToValuesLine = #line; let customRangesToValues: [(NSRange, KernCheckingType)] = [
+            (NSRange(location: 0, length: 2), .kern(5)),
+            (NSRange(location: 2, length: 1), .kern(10)),
+            (NSRange(location: 3, length: 1), .kernRemoved(10)),
             ]
 
         checkKerningValues(customRangesToValues, startingOnLine: customRangesToValuesLine, in: customStyled)

        }
    }

    func testEffectOfAlignmentOnKerningForOneOffStrings() throws {
        let styled = "abcd".styled(with: .tracking(.point(5)))

        let rangesToValuesLine = #line; let rangesToValues: [(NSRange, Double?)] = [
            (NSRange(location: 0, length: 3), 5),
            (NSRange(location: 3, length: 1), nil),
            ]

        checkKerningValues(rangesToValues, startingOnLine: rangesToValuesLine, in: styled)


private extension StringStyleTests {

    enum KernCheckingType {
        case none
        case kern(Double)
        case kernRemoved(Double)
    }

    func checkKerningValues(_ rangesToValues: [(NSRange, KernCheckingType)], startingOnLine rangesToValuesLine: Int, in string: NSAttributedString) {
        for (index, rangeToValue) in rangesToValues.enumerated() {

            let line = UInt(rangesToValuesLine + index + 1)

            let (controlRange, checkingType) = rangeToValue

            let trackingValue = string.attribute(.kern, at: controlRange.location, effectiveRange: nil)
            let trackingRemovedValue = string.attribute(.bonMotRemovedKernAttribute, at: controlRange.location, effectiveRange: nil)

            switch checkingType {
            case .none:
                XCTAssertNil(trackingValue, line: line)
                XCTAssertNil(trackingRemovedValue, line: line)
            case .kern(let kernValue):
                guard let trackingValueNumber = trackingValue as? NSNumber else {
                    XCTFail("Unable to unwrap tracking value \(String(describing: trackingValue)) as Double", line: line)
                    return
                }
                XCTAssertEqual(kernValue, trackingValueNumber.doubleValue, accuracy: 0.0001, line: line)
                XCTAssertNil(trackingRemovedValue, line: line)
            case .kernRemoved(let kernRemovedValue):
                guard let trackingRemovedValueNumber = trackingRemovedValue as? NSNumber else {
                    XCTFail("Unable to unwrap tracking removed value \(String(describing: trackingValue)) as Double", line: line)
                    return
                }
                XCTAssertEqual(kernRemovedValue, trackingRemovedValueNumber.doubleValue, accuracy: 0.0001, line: line)
                XCTAssertNil(trackingValue, line: line)
            }
        }
    }

