Skip to content

Commit

Permalink
added a simple spec
Browse files Browse the repository at this point in the history
  • Loading branch information
solar committed Aug 10, 2015
1 parent fdc8e93 commit 1016e7a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
13 changes: 3 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ organization := "org.sazabi"

version := "0.0.1-SNAPSHOT"

scalaVersion := "2.11.2"
scalaVersion := "2.11.7"

crossScalaVersions := Seq(scalaVersion.value, "2.10.4")
crossScalaVersions := Seq(scalaVersion.value, "2.10.5")

libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.scalatest" %% "scalatest" % "2.2.1" % "test",
"org.scalacheck" %% "scalacheck" % "1.11.5" % "test")
"org.scalatest" %% "scalatest" % "2.2.5" % "test")

incOptions := incOptions.value.withNameHashing(true)

Expand All @@ -21,12 +20,6 @@ scalacOptions ++= Seq(
"-feature",
"-language:experimental.macros")

unmanagedSourceDirectories in Compile <+= (scalaVersion, sourceDirectory in Compile) {
(v, dir) =>
if (v.startsWith("2.10")) dir / "scala210"
else dir / "scala211"
}

publishMavenStyle := true

publishTo <<= version { (v: String) =>
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.5
sbt.version=0.13.8
17 changes: 17 additions & 0 deletions src/test/scala/org/sazabi/regexmacro/RegexSpec.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.sazabi.regexmacro

import org.scalatest._

class RegexSpec extends FlatSpec with Matchers {
"RegexStringContext" should "create Pattern" in {
import imports._

"regex\"\"\"\\w+\"\"\"" should compile

val re = regex"""\w+"""
re.toString shouldBe """\w+"""
re.findAllMatchIn("foo bar").length shouldBe 2

"regex\"\"\"+\"\"\"" shouldNot compile
}
}

0 comments on commit 1016e7a

Please sign in to comment.