usametov / specs

Automatically exported from code.google.com/p/specs
Other
0 stars 0 forks source link

Weird failure for specific value of mutable HashMap #108

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Run spec with this:
    import scala.collection.mutable.HashMap
    "X" should { "Y" in {
        val c = "x" -> "s<script>alert(1)</s"
        HashMap(c) mustEqual HashMap(c)
    }}
When I try to remove something from the string, it fails no longer. If I
add something it still fails.

What is the expected output? What do you see instead?
The spec passes
The spec crushes. See output below.

What version of the product are you using? On what operating system?
1.6.1-2.8.0.Beta1-RC1
Scala version 2.8.0.r20423-b20100109020145 (Java HotSpot(TM) Client VM,
Java 1.6.0_01)

Please provide any additional information below.

Output:

Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.038 sec
<<< FAILURE!
X should Y  Time elapsed: 0.002 sec  <<< ERROR!
org.specs.runner.UserError: java.lang.NoSuchMethodError:
scala.reflect.Manifest$.Int()Ljava/lang/Object;
    at org.specs.util.EditDistance$EditMatrix.<init>(EditDistance.scala:48)
    at org.specs.matcher.AnyBaseMatchers$$anon$2.apply(AnyMatchers.scala:98)
    at org.specs.specification.Expectable.executeMatch$1(Expectable.scala:100)
    at org.specs.specification.Expectable.applyMatcher(Expectable.scala:115)
    at org.specs.specification.Expectation.must(Expectable.scala:169)
    at org.specs.specification.Expectation.mustEqual(Expectable.scala:202)
    at
com.reviews_search.crowler.PageSaverSpec$$anonfun$2$$anonfun$apply$5.apply(PageS
averSpec.scala:62)
    at
com.reviews_search.crowler.PageSaverSpec$$anonfun$2$$anonfun$apply$5.apply(PageS
averSpec.scala:60)
    at
org.specs.specification.LifeCycle$class.withCurrent(ExampleLifeCycle.scala:64)
    at org.specs.specification.Examples.withCurrent(Examples.scala:52)
    at
org.specs.specification.Examples$$anonfun$specifyExample$1.apply(Examples.scala:
108)
    at
org.specs.specification.Examples$$anonfun$specifyExample$1.apply(Examples.scala:
108)
    at
org.specs.specification.ExampleExecution$$anonfun$3$$anonfun$apply$5.apply(Examp
leLifeCycle.scala:195)
    at scala.Option.getOrElse(Option.scala:59)
    at
org.specs.specification.LifeCycle$class.executeExpectations(ExampleLifeCycle.sca
la:86)
    at
org.specs.specification.BaseSpecification.executeExpectations(BaseSpecification.
scala:56)
    at
org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$a
pply$1$$anonfun$apply$2.apply(ExampleContext.scala:58)
    at
org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$a
pply$1$$anonfun$apply$2.apply(ExampleContext.scala:58)
    at scala.Option.map(Option.scala:74)
    at
org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$a
pply$1.apply(ExampleContext.scala:58)
    at
org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$a
pply$1.apply(ExampleContext.scala:58)
    at org.specs.specification.ExampleContext$class.id$1(ExampleContext.scala:31)
    at
org.specs.specification.ExampleContext$$anonfun$1.apply(ExampleContext.scala:32)
    at
org.specs.specification.ExampleContext$$anonfun$1.apply(ExampleContext.scala:32)
    at
org.specs.specification.ExampleContext$$anonfun$executeExpectations$2.apply(Exam
pleContext.scala:58)
    at
org.specs.specification.ExampleContext$$anonfun$executeExpectations$2.apply(Exam
pleContext.scala:57)
    at scala.Option.map(Option.scala:74)
    at
org.specs.specification.ExampleContext$class.executeExpectations(ExampleContext.
scala:57)
    at org.specs.specification.Examples.executeExpectations(Examples.scala:52)
    at
org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$a
pply$1$$anonfun$apply$2.apply(ExampleContext.scala:58)
    at
org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$a
pply$1$$anonfun$apply$2.apply(ExampleContext.scala:58)
    at scala.Option.map(Option.scala:74)
    at
org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$a
pply$1.apply(ExampleContext.scala:58)
    at
org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$a
pply$1.apply(ExampleContext.scala:58)
    at org.specs.specification.ExampleContext$class.id$1(ExampleContext.scala:31)
    at
org.specs.specification.ExampleContext$$anonfun$1.apply(ExampleContext.scala:32)
    at
org.specs.specification.ExampleContext$$anonfun$1.apply(ExampleContext.scala:32)
    at
org.specs.specification.ExampleContext$$anonfun$executeExpectations$2.apply(Exam
pleContext.scala:58)
    at
org.specs.specification.ExampleContext$$anonfun$executeExpectations$2.apply(Exam
pleContext.scala:57)
    at scala.Option.map(Option.scala:74)
    at
org.specs.specification.ExampleContext$class.executeExpectations(ExampleContext.
scala:57)
    at org.specs.specification.Examples.executeExpectations(Examples.scala:52)
    at
org.specs.specification.ExampleExecution$$anonfun$3.apply(ExampleLifeCycle.scala
:195)
    at
org.specs.specification.ExampleExecution$$anonfun$3.apply(ExampleLifeCycle.scala
:182)
    at
org.specs.specification.ExampleExecution$$anonfun$2.apply(ExampleLifeCycle.scala
:165)
    at
org.specs.specification.ExampleExecution.execute(ExampleLifeCycle.scala:215)
    at
org.specs.specification.Examples$$anonfun$executeThis$1.apply(Examples.scala:71)
    at
org.specs.specification.Examples$$anonfun$executeThis$1.apply(Examples.scala:71)
    at scala.Option.map(Option.scala:74)
    at org.specs.specification.Examples.executeThis(Examples.scala:71)
    at
org.specs.specification.ExampleLifeCycle$class.executeExample(ExampleLifeCycle.s
cala:122)
    at org.specs.specification.Examples.executeExample(Examples.scala:52)
    at org.specs.specification.Examples.executeExample(Examples.scala:52)
    at
org.specs.specification.Examples$$anonfun$executeExamples$1.apply(Examples.scala
:80)
    at
org.specs.specification.Examples$$anonfun$executeExamples$1.apply(Examples.scala
:80)
    at scala.Option.map(Option.scala:74)
    at org.specs.specification.Examples.executeExamples(Examples.scala:80)
    at
org.specs.specification.ExampleStructure$class.examples(ExampleStructure.scala:7
7)
    at org.specs.specification.Examples.examples(Examples.scala:52)
    at
org.specs.runner.ExamplesTestSuite$$anonfun$initialize$4.apply(JUnit.scala:158)
    at
org.specs.runner.ExamplesTestSuite$$anonfun$initialize$4.apply(JUnit.scala:154)
    at scala.collection.LinearSeqLike$class.foreach(LinearSeqLike.scala:97)
    at scala.collection.immutable.List.foreach(List.scala:46)
    at org.specs.runner.ExamplesTestSuite.initialize(JUnit.scala:154)
    at org.specs.runner.JUnitSuite$class.init(JUnit.scala:54)
    at org.specs.runner.ExamplesTestSuite.init(JUnit.scala:144)
    at org.specs.runner.JUnitSuite$class.run(JUnit.scala:61)
    at org.specs.runner.ExamplesTestSuite.run(JUnit.scala:173)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.specs.runner.JUnitSuite$class.run(JUnit.scala:62)
    at org.specs.runner.JUnit4.run(JUnit.scala:133)
    at org.specs.runner.JUnitSuiteRunner.run(JUnitSuiteRunner.scala:45)
    at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(Abstra
ctDirectoryTestSuite.java:140)
    at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirec
toryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBoote
r.java:345)
    at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

Original issue reported on code.google.com by tarasevi...@gmail.com on 10 Jan 2010 at 9:37

GoogleCodeExporter commented 8 years ago
Could you please try with the latest specs and scala 2.8?

http://nexus.scala-tools.org/content/repositories/releases/org/scala-
tools/testing/specs_2.8.0.Beta1-RC7/1.6.1/

Thanks.

Original comment by etorrebo...@gmail.com on 11 Jan 2010 at 1:50

GoogleCodeExporter commented 8 years ago
fixed: not repro on specs_2.8.0.Beta1-RC7.
Thanks

Original comment by tarasevi...@gmail.com on 11 Jan 2010 at 5:31

GoogleCodeExporter commented 8 years ago

Original comment by etorrebo...@gmail.com on 11 Jan 2010 at 8:02