The Artima Developer Community
Sponsored Link

ScalaTest/ScalaUtils Forum
Empty test suite error

3 replies on 1 page. Most recent reply: May 30, 2009 11:49 AM by Bill Venners

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Sam Reid

Posts: 2
Nickname: 63276
Registered: Nov, 2008

Empty test suite error Posted: May 29, 2009 9:58 AM
Reply to this message Reply
Advertisement
I'm obtaining a "Empty test suite." message when using FunSuite and 2 tests (inadvertently) have the same name. This is with scalatest-0.9.5, scala 2.7.3 compiled for jvm 1.4 running under scalatest launcher in IntelliJ IDEA 8.1.2

Thanks,
Sam Reid


Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Empty test suite error Posted: May 29, 2009 2:12 PM
Reply to this message Reply
Can you post your FunSuite but without the code. Just the method names. What you should get is a error message complaining that two tests have the same names. It is a rule that each test in a suite has a unique string name.

Sam Reid

Posts: 2
Nickname: 63276
Registered: Nov, 2008

Re: Empty test suite error Posted: May 29, 2009 3:37 PM
Reply to this message Reply
Here's my FunSuite subclass, with test blocks omitted:


class Tester extends FunSuite {
test("battery resistor circuit should have correct voltages and currents for a simple circuit") {
}
test("battery resistor circuit should have correct voltages and currents for a simple circuit") {
}
}


Program output:

Empty test suite.


If I modify the latter test string slightly, the tests run properly.

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Empty test suite error Posted: May 30, 2009 11:49 AM
Reply to this message Reply
Hmm, when I tried it I got what I expected:


scala> :load sam.scala
Loading sam.scala...
defined class Tester

scala> (new Tester).execute()
org.scalatest.TestFailedException: Duplicate test name: battery resistor circuit should have correct voltages and currents for a simple circuit
at org.scalatest.FunSuite$class.test(FunSuite.scala:595)
at Tester.test(<console>:4)
at Tester.<init>(<console>:7)
at .<init>(<console>:6)
at .<clinit>(<console>)
at RequestResult$.<init>(<console>:3)
at RequestResult$.<clinit>(<console...


Can you explain how you are running it?

Flat View: This topic has 3 replies on 1 page
Topic: JUnit4Runner for ScalaTest Previous Topic   Next Topic Topic: unable to compile the StackSpec example

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use