Skip to content

Commit

Permalink
add junit
Browse files Browse the repository at this point in the history
  • Loading branch information
fommil committed Apr 6, 2017
1 parent fbc8900 commit 69ffabe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ language: scala
scala:
- 2.10.6
- 2.11.8
- 2.12.0-M5
- 2.12.1

jdk:
- oraclejdk8
Expand All @@ -21,4 +21,4 @@ cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt/boot
- $HOME/.sbt/launchers/0.13.12
- $HOME/.sbt/launchers/0.13.13
5 changes: 3 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
homepage := Some(url("http://github.com/non/kind-projector"))

scalaVersion := "2.11.8"
crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.0")
crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.1")

libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value
libraryDependencies ++= (scalaBinaryVersion.value match {
Expand Down Expand Up @@ -38,7 +38,8 @@ scalacOptions in Test += "-Xplugin:" + (packageBin in Compile).value

scalacOptions in Test += "-Yrangepos"

test := (run in Test).toTask("").value
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v")

def scala210ExtraDeps = Seq(
compilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full),
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.12
sbt.version=0.13.13
7 changes: 5 additions & 2 deletions src/test/scala/polylambda.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package d_m

import org.junit.Test

trait ~>[-F[_], +G[_]] {
def apply[A](x: F[A]): G[A]
}
Expand All @@ -8,7 +10,7 @@ trait ~>>[-F[_], +G[_]] {
}
final case class Const[A, B](getConst: A)

object PolyLambdas {
class PolyLambdas {
type ToSelf[F[_]] = F ~> F

val kf1 = Lambda[Option ~> Vector](_.toVector)
Expand Down Expand Up @@ -45,7 +47,8 @@ object PolyLambdas {
def const5[A] : ToSelf[Const[A, ?]] = λ[ToSelf[λ[B => Const[A, B]]]](x => x)
def const6[A] : Const[A, ?] ~> Const[A, ?] = λ[ToSelf[λ[B => Const[A, B]]]](x => x)

def main(args: Array[String]): Unit = {
@Test
def polylambda(): Unit = {
assert(kf1(None) == Vector())
assert(kf1(Some("a")) == Vector("a"))
assert(kf1(Some(5d)) == Vector(5d))
Expand Down

0 comments on commit 69ffabe

Please sign in to comment.