Skip to content
Simple way to identify whats different between 2 instances in Kotlin . inspired by krzysztofzablocki/Difference
Kotlin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper First commit Sep 6, 2019
src Fix test Sep 6, 2019
LICENSE Add LICENSE Sep 6, 2019
README.md Add usage Sep 6, 2019
build.gradle
gradle.properties
settings.gradle

README.md

kdiff

Simple way to identify whats different between 2 instances. inspired by krzysztofzablocki/Difference

Usage

assertDataEquals(expected, actual)

before

Expected :[Article(title=Can detect title diff, writer=Writer(name=takahirom), tags=[Tag(name=Kotlin), Tag(name=Multiplatform), Tag(name=Android)], dateTime=DateTime(date=Date(month=10, dayOfMonth=23), time=Time(hour=9, minute=0))), Article(title=Can detect list size diff, writer=Writer(name=takahirom), tags=[Tag(name=Kotlin), Tag(name=Multiplatform), Tag(name=Android)], dateTime=DateTime(date=Date(month=10, dayOfMonth=23), time=Time(hour=9, minute=0))), Article(title=Can detect nested class diff, writer=Writer(name=takahirom), tags=[Tag(name=Kotlin), Tag(name=Multiplatform), Tag(name=Android)], dateTime=DateTime(date=Date(month=10, dayOfMonth=23), time=Time(hour=9, minute=0)))]
Actual :[Article(title=Can detect title change?, writer=Writer(name=takahirom), tags=[Tag(name=Kotlin), Tag(name=Multiplatform), Tag(name=Android)], dateTime=DateTime(date=Date(month=10, dayOfMonth=23), time=Time(hour=9, minute=0))), Article(title=Can detect list size diff, writer=Writer(name=takahirom), tags=[Tag(name=Kotlin), Tag(name=Multiplatform), Tag(name=Android), Tag(name=Test)], dateTime=DateTime(date=Date(month=10, dayOfMonth=23), time=Time(hour=9, minute=0))), Article(title=Can detect nested class diff, writer=Writer(name=takahirom), tags=[Tag(name=Kotlin), Tag(name=Multiplatform), Tag(name=Android)], dateTime=DateTime(date=Date(month=10, dayOfMonth=23), time=Time(hour=9, minute=1)))]

after

java.lang.AssertionError: 
target[0].title Expected <Can detect title diff>, actual <Can detect title change?> is not same.
target[1].tags Expected size <3>, actual size <4> is not same.
target[2].dateTime.time.minute Expected <0>, actual <1> is not same.
You can’t perform that action at this time.