mirror of
https://github.com/nicklockwood/SwiftFormat.git
synced 2026-06-16 10:34:34 +00:00
33 lines
769 B
Swift
33 lines
769 B
Swift
//
|
|
// RedundantLetErrorTests.swift
|
|
// SwiftFormatTests
|
|
//
|
|
// Created by Nick Lockwood on 12/16/18.
|
|
// Copyright © 2024 Nick Lockwood. All rights reserved.
|
|
//
|
|
|
|
import XCTest
|
|
@testable import SwiftFormat
|
|
|
|
final class RedundantLetErrorTests: XCTestCase {
|
|
func testCatchLetError() {
|
|
let input = """
|
|
do {} catch let error {}
|
|
"""
|
|
let output = """
|
|
do {} catch {}
|
|
"""
|
|
testFormatting(for: input, output, rule: .redundantLetError)
|
|
}
|
|
|
|
func testCatchLetErrorWithTypedThrows() {
|
|
let input = """
|
|
do throws(Foo) {} catch let error {}
|
|
"""
|
|
let output = """
|
|
do throws(Foo) {} catch {}
|
|
"""
|
|
testFormatting(for: input, output, rule: .redundantLetError)
|
|
}
|
|
}
|