Skip to content

Commit

Permalink
Add more tests for partial functions
Browse files Browse the repository at this point in the history
  • Loading branch information
densh committed Mar 10, 2014
1 parent 6dbd770 commit f6712e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/files/scalacheck/quasiquotes/TermConstructionProps.scala
Expand Up @@ -305,4 +305,9 @@ object TermConstructionProps extends QuasiquoteProperties("term construction") {
q"$scrutinee match { case ..$cases }"
}
}

property("construct partial function") = test {
val cases = List(cq"a => b", cq"c => d")
assertEqAst(q"{ case ..$cases }", "{ case a => b case c => d }")
}
}
Expand Up @@ -217,4 +217,9 @@ object TermDeconstructionProps extends QuasiquoteProperties("term deconstruction
val q"$_ match { case ..$_ }" = q"{ case _ => }"
}
}

property("deconstruct partial function") = test {
val q"{ case ..$cases }" = q"{ case a => b case c => d }"
val List(cq"a => b", cq"c => d") = cases
}
}

0 comments on commit f6712e4

Please sign in to comment.