Displays test results in Xcode Playground

Updated
May 5, 2020 8:17 AM
Created
May 5, 2020 8:16 AM
Tags
Swift
Keywords

ๆ˜”ใ ใ‚Œใ‹ใฎใ‚ขใ‚คใƒ‡ใ‚ขใงใฟใŸใ“ใจใŒใ‚ใฃใŸใ‘ใฉใ€่จ˜ไบ‹ใ‚’ๅฟ˜ใ‚Œใฆใ—ใพใฃใŸใฎใง่‡ชๅˆ†ใงไฝœใฃใŸใ€‚

image
import Foundation

// Playground Testing

fileprivate let success = "โœ…"
fileprivate let failure = "โŒ"

public enum PT {

  public static func assertEqual<T: Equatable>(_ lhs: T, _ rhs: T) -> String {
    lhs == rhs ? success : failure
  }
  
}