All Projects → Kuniwak → Mirrordiffkit

Kuniwak / Mirrordiffkit

Licence: other
Graduation from messy XCTAssertEqual messages.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Mirrordiffkit

Predicateflow
Write amazing, strong-typed and easy-to-read NSPredicate.
Stars: ✭ 98 (-41.67%)
Mutual labels:  library, tvos, watchos
Alley
Essential `URLSessionDataTask` micro-wrapper for communication with HTTP(S) web services, with built-in automatic request retries.
Stars: ✭ 137 (-18.45%)
Mutual labels:  tvos, watchos
Contentful.swift
A delightful Swift interface to Contentful's content delivery API.
Stars: ✭ 132 (-21.43%)
Mutual labels:  tvos, watchos
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (-17.86%)
Mutual labels:  tvos, watchos
Persistencekit
Store and retrieve Codable objects to various persistence layers, in a couple lines of code!
Stars: ✭ 121 (-27.98%)
Mutual labels:  tvos, watchos
Iconic
🎨 Auto-generated icon font library for iOS, watchOS and tvOS
Stars: ✭ 1,567 (+832.74%)
Mutual labels:  tvos, watchos
Opencombine
Open source implementation of Apple's Combine framework for processing values over time.
Stars: ✭ 2,040 (+1114.29%)
Mutual labels:  tvos, watchos
Mapboxgeocoder.swift
Address search and reverse geocoding in Swift or Objective-C on iOS, macOS, tvOS, and watchOS
Stars: ✭ 115 (-31.55%)
Mutual labels:  tvos, watchos
Noticeobservekit
NoticeObserveKit is type-safe NotificationCenter wrapper.
Stars: ✭ 147 (-12.5%)
Mutual labels:  tvos, watchos
Berkanansdk
Bluetooth mesh messaging SDK for apps
Stars: ✭ 150 (-10.71%)
Mutual labels:  tvos, watchos
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (-5.95%)
Mutual labels:  tvos, watchos
Sqift
Powerful Swift wrapper for SQLite
Stars: ✭ 119 (-29.17%)
Mutual labels:  tvos, watchos
Surmagic
🚀 The better way to deal with Binary Frameworks on iOS, Mac Catalyst, tvOS, macOS, and watchOS. Create XCFrameworks with ease.
Stars: ✭ 119 (-29.17%)
Mutual labels:  tvos, watchos
Cloudkitgdpr
Framework for allowing users to manage data stored in iCloud
Stars: ✭ 126 (-25%)
Mutual labels:  tvos, watchos
Swiftui Kit
A SwiftUI system components and interactions demo app
Stars: ✭ 1,733 (+931.55%)
Mutual labels:  tvos, watchos
Swiftui Shapes
🚀 Collection of SwiftUI shapes
Stars: ✭ 137 (-18.45%)
Mutual labels:  tvos, watchos
Version
Represent and compare versions via semantic versioning (SemVer) in Swift
Stars: ✭ 160 (-4.76%)
Mutual labels:  tvos, watchos
Articles Zh Hans
Articles for NSHipster.cn
Stars: ✭ 113 (-32.74%)
Mutual labels:  tvos, watchos
Mapbox Directions Swift
Traffic-aware directions and map matching in Swift on iOS, macOS, tvOS, watchOS, and Linux
Stars: ✭ 115 (-31.55%)
Mutual labels:  tvos, watchos
Color
Color utilities for macOS, iOS, tvOS, and watchOS
Stars: ✭ 145 (-13.69%)
Mutual labels:  tvos, watchos

MirrorDiffKit

Swift 5.0 compatible CocoaPods Carthage Swift Package Manager MIT license

A tool for providing the 2 features for efficient testing:

  • Output diff between 2 any types
  • Default implementation of Equatable for any types

Platform Status
macOS Bitrise
Linux CircleCI

Usage

diff<T>(between: T, and: T)

import MirrorDiffKit

// Input 2 structs or classes implements Equatable:
let a = Example(
    key1: "I'm not changed",
    key2: "I'm deleted"
)
let b = Example(
    key1: "I'm not changed",
    key2: "I'm inserted"
)


XCTAssertEqual(a, b, diff(between: a, and: b))

// XCTAssertEqual failed: ("Example(key1: "I\'m not changed", key2: "I\'m deleted")") is not equal to ("Example(key1: "I\'m not changed", key2: "I\'m inserted")") - 
//     struct Example {
//         key1: "I'm not changed"
//       - key2: "I'm deleted"
//       + key2: "I'm inserted"
//     }

Any =~ Any and Any !~ Any

import MirrorDiffKit

a = NotEquatable(
    key1: "I'm not changed",
    key2: "I'm deleted"
)
b = NotEquatable(
    key1: "I'm not changed",
    key2: "I'm inserted"
)


XCTAssert(a =~ b, diff(between: a, and: b))

// XCTAssertTrue failed - 
//     struct NotEquatable {
//         key1: "I'm not changed"
//       - key2: "I'm deleted"
//       + key2: "I'm inserted"
//     }

Installation

Swift Package Manager

Add the following line to your Package.swift:

.package(url: "https://github.com/Kuniwak/MirrorDiffKit.git")

Carthage

Add the following line to your Cartfile:

github "Kuniwak/MirrorDiffKit"

CocoaPods

pod "MirrorDiffKit"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].