File tree Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,15 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
5
5
## [ Unreleased]
6
6
7
+ ## 1.0.3 - 2016-11-29
8
+ * Added ` equals ` implementation for ` Patch `
9
+ * Added Scala 2.12 support
10
+
7
11
## 1.0.2 - 2016-11-28
8
12
* Add apply syntax for ` Patch `
9
13
10
14
## 1.0.1 - 2016-11-28
11
15
* Minor cleanup
12
16
13
17
## 1.0.0 - 2016-11-27
14
- * Initial release
18
+ * Initial release
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ val versions = new {
8
8
}
9
9
10
10
val commonSettings = Seq (
11
- version := " 1.0.2 " ,
11
+ version := " 1.0.3 " ,
12
12
scalaVersion := " 2.11.8" ,
13
13
crossScalaVersions := Seq (" 2.11.8" ," 2.12.1" ),
14
14
organization := " io.github.jeremyrsmith" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ import scala.language.dynamics
11
11
abstract class Patch [T ] extends (T => T ) {
12
12
type Updates <: HList
13
13
def updates : Updates
14
+
15
+ override def equals (obj : scala.Any ): Boolean = obj match {
16
+ case patch : Patch [_] => patch.updates == updates
17
+ case _ => false
18
+ }
14
19
}
15
20
16
21
object Patch extends Dynamic {
@@ -53,6 +58,7 @@ object Patch extends Dynamic {
53
58
) {
54
59
def patchUpdates : U = patch.updates.asInstanceOf [U ]
55
60
}
61
+
56
62
}
57
63
58
64
// Macros to support patch Apply syntax
Original file line number Diff line number Diff line change @@ -107,5 +107,11 @@ class PatchSpec extends FreeSpec with Matchers {
107
107
108
108
}
109
109
110
+ " comparison" in {
111
+ case class Foo (a : Int , b : String )
112
+ Patch [Foo ](a = 10 ) shouldEqual Patch [Foo ](a = 10 )
113
+ Patch [Foo ](a = 10 ) shouldNot equal (Patch [Foo ](a = 11 ))
114
+ }
115
+
110
116
111
117
}
You can’t perform that action at this time.
0 commit comments