Skip to content

Commit

Permalink
Using Tuple1 syntactic sugar in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrandjean committed Jan 19, 2022
1 parent 286a501 commit fe06d5b
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,32 +196,32 @@ class AnnotationTests {

@Test
def allAnnotations: Unit = {
type T1First = Tuple1[First]
val first: T1First = Tuple1(First())
type T1First = First *: EmptyTuple.type
val first: T1First = First() *: EmptyTuple

val cc: (T1First, EmptyTuple.type, (Second, Third)) = AllAnnotations[CC3].apply()
assert(cc == (first, EmptyTuple, (Second(2, "b"), Third('c'))))

type T1Second = Tuple1[Second]
val second: T1Second = Tuple1(Second(3, "e"))
type T1Second = Second *: EmptyTuple.type
val second: T1Second = Second(3, "e") *: EmptyTuple

val st: (T1First, T1Second) = AllAnnotations[Base].apply()
assert(st == (first, second))
}

@Test
def allTypeAnnotations: Unit = {
type T1First = Tuple1[First]
val first: T1First = Tuple1(First())
type T1First = First *: EmptyTuple.type
val first: T1First = First() *: EmptyTuple

val st: (T1First, (Second, Third)) = AllTypeAnnotations[Base2].apply() // sealed trait
assert(st == (first, (Second(3, "e"), Third('c'))))

val cc: (T1First, EmptyTuple.type, (Second, Third)) = AllTypeAnnotations[CC4].apply() // case class
assert(cc == (first, EmptyTuple, (Second(2, "b"), Third('c'))))

type T1Third = Tuple1[Third]
val third: T1Third = Tuple1(Third('c'))
type T1Third = Third *: EmptyTuple.type
val third: T1Third = Third('c') *: EmptyTuple

val user: (T1First, T1Third) = AllTypeAnnotations[User].apply() // type refs
assert(user == (first, third))
Expand Down

0 comments on commit fe06d5b

Please sign in to comment.