Skip to content

Instantly share code, notes, and snippets.

@fff
Created June 21, 2011 06:52
Show Gist options
  • Save fff/1037364 to your computer and use it in GitHub Desktop.
Save fff/1037364 to your computer and use it in GitHub Desktop.
java.lang.ClassCastException: scala.collection.immutable.Range$Inclusive cannot be cast to scala.collection.immutable.Range$ByOne
import org.specs.runner.JUnit4
import org.specs.SpecificationWithJUnit
class ClassCastSpec extends JUnit4(ClassCastSpec)
object ClassCastSpec extends SpecificationWithJUnit {
"test String must_== with self" in {
val data: String = "TEST_CONTENT_($*@:KFDSLU#&*@!943298742"
"TEST_CONTENT_($*@:KFDSLU#&*@!943298742" must_== data
}
}
/*
test String must_== with self(996025164) Time elapsed: 0.015 sec <<< ERROR!
6 org.specs.runner.UserError: java.lang.ClassCastException: scala.collection.immutable.Range$Inclusive cannot be cast to scala.collection.immutable.Range$ByOne
7 at org.specs.util.EditDistance$EditMatrix.<init>(EditDistance.scala:51)
8 at org.specs.matcher.AnyBaseMatchers$$anon$2.apply(AnyMatchers.scala:103)
9 at org.specs.specification.Expectable.executeMatch$1(Expectable.scala:101)
10 at org.specs.specification.Expectable.applyMatcher(Expectable.scala:116)
11 at org.specs.specification.Expectation.must(Expectable.scala:172)
12 at org.specs.specification.Expectation.must_$eq$eq(Expectable.scala:201)
13 at lt.base.lemon.ClassCastSpec$$anonfun$1.apply(ClassCastSpec.scala:9)
14 at lt.base.lemon.ClassCastSpec$$anonfun$1.apply(ClassCastSpec.scala:7)
15 at org.specs.specification.LifeCycle$class.withCurrent(ExampleLifeCycle.scala:60)
16 at org.specs.specification.Examples.withCurrent(Examples.scala:52)
17 at org.specs.specification.Examples$$anonfun$specifyExample$1.apply(Examples.scala:111)
18 at org.specs.specification.Examples$$anonfun$specifyExample$1.apply(Examples.scala:111)
19 at org.specs.specification.ExampleExecution$$anonfun$3$$anonfun$apply$5.apply(ExampleLifeCycle.scala:211)
20 at scala.Option.getOrElse(Option.scala:109)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment