Skip to content

Instantly share code, notes, and snippets.

@archeg
Last active August 29, 2015 14:09
Show Gist options
  • Save archeg/e5618c52f5661f494418 to your computer and use it in GitHub Desktop.
Save archeg/e5618c52f5661f494418 to your computer and use it in GitHub Desktop.
import android.Keys._
android.Plugin.androidBuild
name := "power-wlan"
scalaVersion := "2.11.3"
proguardCache in Android ++= Seq(
ProguardCache("org.scaloid") % "org.scaloid"
)
scalaSource in Test <<= baseDirectory(_ / "test")
scalaSource in Compile <<= baseDirectory(_ / "src")
proguardOptions in Android ++= Seq("-dontobfuscate", "-dontoptimize", "-keepattributes Signature"
, "-dontwarn scala.collection.**" // required from Scala 2.11.3
, "-dontwarn scala.collection.mutable.**" // required from Scala 2.11.0
)
resolvers ++= Seq(
"Sonatype Releases" at "http://oss.sonatype.org/content/repositories/releases"
)
libraryDependencies ++= Seq(
"org.scalacheck" %% "scalacheck" % "1.11.6" % "test"
)
libraryDependencies += "org.scaloid" %% "scaloid" % "3.6-10" withSources() withJavadoc()
//libraryDependencies += "org.scalatest" % "scalatest_2.11" % "2.2.2" % "test"
//libraryDependencies += "org.scala-tools.testing" %% "scalacheck" % "1.9" % "test"
scalacOptions in Compile += "-feature"
run <<= run in Android
install <<= install in Android
import org.scalacheck.Properties
import org.scalacheck.Prop.forAll
object StringSpecification extends Properties("String") {
property("startsWith") = forAll { (a: String, b: String) =>
(a+b).startsWith(a)
}
property("concatenate") = forAll { (a: String, b: String) =>
(a+b).length > a.length && (a+b).length > b.length
}
property("substring") = forAll { (a: String, b: String, c: String) =>
(a+b+c).substring(a.length, a.length+b.length) == b
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment