Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Kuniwak/MirrorDiffKit
Graduation from messy XCTAssertEqual messages.
https://github.com/Kuniwak/MirrorDiffKit
diff ios library macos swift testing tvos watchos
Last synced: about 2 months ago
JSON representation
Graduation from messy XCTAssertEqual messages.
- Host: GitHub
- URL: https://github.com/Kuniwak/MirrorDiffKit
- Owner: Kuniwak
- License: other
- Created: 2017-02-24T13:52:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T00:23:59.000Z (8 months ago)
- Last Synced: 2024-04-14T18:33:26.617Z (2 months ago)
- Topics: diff, ios, library, macos, swift, testing, tvos, watchos
- Language: Swift
- Homepage:
- Size: 771 KB
- Stars: 180
- Watchers: 5
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-ios - MirrorDiffKit - Pretty diff between any structs or classes. (Testing / Other Testing)
- awesome-stars - Kuniwak/MirrorDiffKit - Graduation from messy XCTAssertEqual messages. (Swift)
- awesome-ios2 - MirrorDiffKit - Pretty diff between any structs or classes (Testing / Other free courses)
- awesome-ios - MirrorDiffKit - Pretty diff between any structs or classes (Testing / Other free courses)
- awesome-ios-star - MirrorDiffKit - Pretty diff between any structs or classes. (Testing / Other Testing)
- awesome-ios - MirrorDiffKit - Pretty diff between any structs or classes (Testing / Other free courses)
- awesome-ios - MirrorDiffKit - Pretty diff between any structs or classes. (Testing / Other Testing)
- awesome-ios - MirrorDiffKit - Pretty diff between any structs or classes. (Testing / Other Testing)
- awesome-ios - MirrorDiffKit - Pretty diff between any structs or classes. (Testing / Other Testing)
- awesome-ios - MirrorDiffKit - Pretty diff between any structs or classes :large_orange_diamond: (Testing / Other free courses)
- awesome-iosx - MirrorDiffKit - Pretty diff between any structs or classes. (Testing / Other Testing)
- awesome-ios - MirrorDiffKit - Pretty diff between any structs or classes. (Testing / Other Testing)
- awesome-iosr - MirrorDiffKit - Pretty diff between any structs or classes. (Testing / Other Testing)
- learn.awesome-iOS - MirrorDiffKit - Pretty diff between any structs or classes :large_orange_diamond: (Testing)
- learn.awesome.ios - MirrorDiffKit - Pretty diff between any structs or classes. (Testing / Other Testing)
README
![MirrorDiffKit](https://raw.githubusercontent.com/Kuniwak/MirrorDiffKit/master/Documentation/Images/logo.png)
=============![Swift 5.0 compatible](https://img.shields.io/badge/Swift%20version-5.0-green.svg)
![CocoaPods](https://img.shields.io/cocoapods/v/MirrorDiffKit.svg)
![Carthage](https://img.shields.io/badge/Carthage-compatible-green.svg)
![Swift Package Manager](https://img.shields.io/badge/SPM-compatible-green.svg)
[![MIT license](https://img.shields.io/badge/lisence-MIT-yellow.svg)](https://github.com/Kuniwak/MirrorDiffKit/blob/master/LICENSE)A tool for providing the 2 features for efficient testing:
- Output diff between 2 any types
- Default implementation of Equatable for any types![](./Documentation/Images/XcodePreview.png)
| Platform | Status |
|:---------|:------:|
| macOS | [![Bitrise](https://app.bitrise.io/app/94e8fe199a9a670b/status.svg?token=XaNhf80F5x3pimGVlyPb-w&branch=master)](https://app.bitrise.io/app/94e8fe199a9a670b) |
| Linux | [![CircleCI](https://circleci.com/gh/Kuniwak/MirrorDiffKit/tree/master.svg?style=svg)](https://circleci.com/gh/Kuniwak/MirrorDiffKit/tree/master) |Usage
-----### `diff(between: T, and: T)`
```swift
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`
```swift
import MirrorDiffKita = 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 ManagerAdd 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
```ruby
pod "MirrorDiffKit"
```