replace unicode arrows

* ⇒, →, ←
* because we don't want to show them in documentation snippets and
  then it's complicated to avoid that when snippets are
  located in src/test/scala in individual modules
* dont replace object `→` in FSM.scala and PersistentFSM.scala
This commit is contained in:
Patrik Nordwall 2019-02-09 15:25:39 +01:00
parent e4d38f92a4
commit 5c96a5f556
1521 changed files with 18846 additions and 18786 deletions

View file

@ -234,8 +234,8 @@ class ORSetSpec extends WordSpec with Matchers {
def asAddDeltaOp(delta: Any): ORSet.AddDeltaOp[String] =
delta match {
case d: ORSet.AddDeltaOp[String] @unchecked d
case _ throw new IllegalArgumentException("Expected AddDeltaOp")
case d: ORSet.AddDeltaOp[String] @unchecked => d
case _ => throw new IllegalArgumentException("Expected AddDeltaOp")
}
"work for additions" in {
@ -486,30 +486,30 @@ class ORSetSpec extends WordSpec with Matchers {
"ORSet unit test" must {
"verify subtractDots" in {
val dot = VersionVector(TreeMap(nodeA 3L, nodeB 2L, nodeD 14L, nodeG 22L))
val vvector = VersionVector(TreeMap(nodeA 4L, nodeB 1L, nodeC 1L, nodeD 14L, nodeE 5L, nodeF 2L))
val expected = VersionVector(TreeMap(nodeB 2L, nodeG 22L))
val dot = VersionVector(TreeMap(nodeA -> 3L, nodeB -> 2L, nodeD -> 14L, nodeG -> 22L))
val vvector = VersionVector(TreeMap(nodeA -> 4L, nodeB -> 1L, nodeC -> 1L, nodeD -> 14L, nodeE -> 5L, nodeF -> 2L))
val expected = VersionVector(TreeMap(nodeB -> 2L, nodeG -> 22L))
ORSet.subtractDots(dot, vvector) should be(expected)
}
"verify mergeCommonKeys" in {
val commonKeys: Set[String] = Set("K1", "K2")
val thisDot1 = VersionVector(TreeMap(nodeA 3L, nodeD 7L))
val thisDot2 = VersionVector(TreeMap(nodeB 5L, nodeC 2L))
val thisVvector = VersionVector(TreeMap(nodeA 3L, nodeB 5L, nodeC 2L, nodeD 7L))
val thisDot1 = VersionVector(TreeMap(nodeA -> 3L, nodeD -> 7L))
val thisDot2 = VersionVector(TreeMap(nodeB -> 5L, nodeC -> 2L))
val thisVvector = VersionVector(TreeMap(nodeA -> 3L, nodeB -> 5L, nodeC -> 2L, nodeD -> 7L))
val thisSet = new ORSet(
elementsMap = Map("K1" thisDot1, "K2" thisDot2),
elementsMap = Map("K1" -> thisDot1, "K2" -> thisDot2),
vvector = thisVvector)
val thatDot1 = VersionVector(nodeA, 3L)
val thatDot2 = VersionVector(nodeB, 6L)
val thatVvector = VersionVector(TreeMap(nodeA 3L, nodeB 6L, nodeC 1L, nodeD 8L))
val thatVvector = VersionVector(TreeMap(nodeA -> 3L, nodeB -> 6L, nodeC -> 1L, nodeD -> 8L))
val thatSet = new ORSet(
elementsMap = Map("K1" thatDot1, "K2" thatDot2),
elementsMap = Map("K1" -> thatDot1, "K2" -> thatDot2),
vvector = thatVvector)
val expectedDots = Map(
"K1" VersionVector(nodeA, 3L),
"K2" VersionVector(TreeMap(nodeB 6L, nodeC 2L)))
"K1" -> VersionVector(nodeA, 3L),
"K2" -> VersionVector(TreeMap(nodeB -> 6L, nodeC -> 2L)))
ORSet.mergeCommonKeys(commonKeys, thisSet, thatSet) should be(expectedDots)
}
@ -517,14 +517,14 @@ class ORSetSpec extends WordSpec with Matchers {
"verify mergeDisjointKeys" in {
val keys: Set[Any] = Set("K3", "K4", "K5")
val elements: Map[Any, VersionVector] = Map(
"K3" VersionVector(nodeA, 4L),
"K4" VersionVector(TreeMap(nodeA 3L, nodeD 8L)),
"K5" VersionVector(nodeA, 2L))
val vvector = VersionVector(TreeMap(nodeA 3L, nodeD 7L))
val acc: Map[Any, VersionVector] = Map("K1" VersionVector(nodeA, 3L))
"K3" -> VersionVector(nodeA, 4L),
"K4" -> VersionVector(TreeMap(nodeA -> 3L, nodeD -> 8L)),
"K5" -> VersionVector(nodeA, 2L))
val vvector = VersionVector(TreeMap(nodeA -> 3L, nodeD -> 7L))
val acc: Map[Any, VersionVector] = Map("K1" -> VersionVector(nodeA, 3L))
val expectedDots = acc ++ Map(
"K3" VersionVector(nodeA, 4L),
"K4" VersionVector(nodeD, 8L)) // "a" -> 3 removed, optimized to include only those unseen
"K3" -> VersionVector(nodeA, 4L),
"K4" -> VersionVector(nodeD, 8L)) // "a" -> 3 removed, optimized to include only those unseen
ORSet.mergeDisjointKeys(keys, elements, vvector, acc) should be(expectedDots)
}
@ -612,7 +612,7 @@ class ORSetSpec extends WordSpec with Matchers {
val elements2: Set[String] = elements1
Changed(ORSetKey[String]("key"))(s1) match {
case c @ Changed(ORSetKey("key"))
case c @ Changed(ORSetKey("key")) =>
val x: ORSet[String] = c.dataValue
val ORSet(elements3) = c.dataValue
val elements4: Set[String] = elements3
@ -621,7 +621,7 @@ class ORSetSpec extends WordSpec with Matchers {
val msg: Any = Changed(ORSetKey[String]("key"))(s1)
msg match {
case c @ Changed(ORSetKey("key"))
case c @ Changed(ORSetKey("key")) =>
val ORSet(elements3) = c.dataValue // `unapply(a: ReplicatedData)` is used here
// if `unapply(a: ReplicatedData)` isn't defined the next line doesn't compile:
// type mismatch; found : scala.collection.immutable.Set[A] where type A required: Set[Any] Note: A <: Any,