Skip to content

Commit

Permalink
Merge pull request #7 from xuwei-k/procedure-syntax
Browse files Browse the repository at this point in the history
fix procedure syntax
  • Loading branch information
eed3si9n authored Oct 19, 2024
2 parents 8c84796 + a44fc78 commit e0db1f5
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 38 deletions.
10 changes: 5 additions & 5 deletions src/test/scala/sbt/testing/NestedSuiteSelectorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ class NestedSuiteSelectorSpec extends UnitSpec {
object `a NestedSuiteSelector` {
val redNestedSuiteSelector = new NestedSuiteSelector("red")
val blueNestedSuiteSelector = new NestedSuiteSelector("blue")
def `should give back what you put into it` {
def `should give back what you put into it`: Unit = {
redNestedSuiteSelector.suiteId shouldBe "red"
blueNestedSuiteSelector.suiteId shouldBe "blue"
}
def `should have a properly behaving equals method` {
def `should have a properly behaving equals method`: Unit = {
redNestedSuiteSelector shouldEqual redNestedSuiteSelector
redNestedSuiteSelector shouldEqual new NestedSuiteSelector("red")
redNestedSuiteSelector shouldEqual new NestedSuiteSelector(red())
Expand All @@ -20,19 +20,19 @@ class NestedSuiteSelectorSpec extends UnitSpec {
redNestedSuiteSelector should not equal "howdy"
redNestedSuiteSelector should not equal new SuiteSelector
}
def `should have a properly behaving hashCode method` {
def `should have a properly behaving hashCode method`: Unit = {
redNestedSuiteSelector.hashCode shouldEqual redNestedSuiteSelector.hashCode
redNestedSuiteSelector.hashCode shouldEqual (new NestedSuiteSelector("red")).hashCode
redNestedSuiteSelector.hashCode should not equal blueNestedSuiteSelector.hashCode
blueNestedSuiteSelector.hashCode shouldEqual blueNestedSuiteSelector.hashCode
blueNestedSuiteSelector.hashCode shouldEqual (new NestedSuiteSelector("blue")).hashCode
}
def `should throw NPE from constructor of null passed` {
def `should throw NPE from constructor of null passed`: Unit = {
a [NullPointerException] should be thrownBy {
new NestedSuiteSelector(null)
}
}
def `should have a pretty toString` {
def `should have a pretty toString`: Unit = {
redNestedSuiteSelector.toString shouldEqual "NestedSuiteSelector(red)"
blueNestedSuiteSelector.toString shouldEqual "NestedSuiteSelector(blue)"
}
Expand Down
10 changes: 5 additions & 5 deletions src/test/scala/sbt/testing/NestedTestSelectorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class NestedTestSelectorSpec extends UnitSpec {
val blueBirdNestedTestSelector = new NestedTestSelector("blue", "bird")
val redFishNestedTestSelector = new NestedTestSelector("red", "fish")
val blueFishNestedTestSelector = new NestedTestSelector("blue", "fish")
def `should give back what you put into it` {
def `should give back what you put into it`: Unit = {
redBirdNestedTestSelector.suiteId shouldBe "red"
redBirdNestedTestSelector.testName shouldBe "bird"
blueBirdNestedTestSelector.suiteId shouldBe "blue"
Expand All @@ -19,7 +19,7 @@ class NestedTestSelectorSpec extends UnitSpec {
blueFishNestedTestSelector.suiteId shouldBe "blue"
blueFishNestedTestSelector.testName shouldBe "fish"
}
def `should have a properly behaving equals method` {
def `should have a properly behaving equals method`: Unit = {
redBirdNestedTestSelector shouldEqual redBirdNestedTestSelector
redBirdNestedTestSelector shouldEqual new NestedTestSelector("red", "bird")
redBirdNestedTestSelector shouldEqual new NestedTestSelector(red(), "bird")
Expand All @@ -30,23 +30,23 @@ class NestedTestSelectorSpec extends UnitSpec {
redBirdNestedTestSelector should not equal "howdy"
redBirdNestedTestSelector should not equal new SuiteSelector
}
def `should have a properly behaving hashCode method` {
def `should have a properly behaving hashCode method`: Unit = {
redBirdNestedTestSelector.hashCode shouldEqual redBirdNestedTestSelector.hashCode
redBirdNestedTestSelector.hashCode shouldEqual (new NestedTestSelector("red", "bird")).hashCode
redBirdNestedTestSelector.hashCode should not equal blueBirdNestedTestSelector.hashCode
redBirdNestedTestSelector.hashCode should not equal redFishNestedTestSelector.hashCode
blueBirdNestedTestSelector.hashCode shouldEqual blueBirdNestedTestSelector.hashCode
blueBirdNestedTestSelector.hashCode shouldEqual (new NestedTestSelector("blue", "bird")).hashCode
}
def `should throw NPE from constructor if null passed` {
def `should throw NPE from constructor if null passed`: Unit = {
a [NullPointerException] should be thrownBy {
new NestedTestSelector(null, "bird")
}
a [NullPointerException] should be thrownBy {
new NestedTestSelector("red", null)
}
}
def `should have a pretty toString` {
def `should have a pretty toString`: Unit = {
redBirdNestedTestSelector.toString shouldEqual "NestedTestSelector(red, bird)"
blueBirdNestedTestSelector.toString shouldEqual "NestedTestSelector(blue, bird)"
}
Expand Down
20 changes: 10 additions & 10 deletions src/test/scala/sbt/testing/OptionalThrowableSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,38 @@ class OptionalThrowableSpec extends UnitSpec {
val def2 = new OptionalThrowable(ex2)
val undef = new OptionalThrowable()
object `when defined` {
def `should say it is defined` {
def `should say it is defined`: Unit = {
def1.isDefined shouldBe true
def2.isDefined shouldBe true
}
def `should say it is not empty` {
def `should say it is not empty`: Unit = {
def1.isEmpty shouldBe false
def2.isEmpty shouldBe false
}
def `should return the Throwable from its get method` {
def `should return the Throwable from its get method`: Unit = {
def1.get shouldBe ex1
def2.get shouldBe ex2
}
}
object `when empty` {
def `should say it is not defined` {
def `should say it is not defined`: Unit = {
undef.isDefined shouldBe false
}
def `should say it is empty` {
def `should say it is empty`: Unit = {
undef.isEmpty shouldBe true
}
def `should return throw IllegalStateException from its get method` {
def `should return throw IllegalStateException from its get method`: Unit = {
an [IllegalStateException] should be thrownBy {
undef.get
}
}
}
def `should throw NPE from constructor if null passed` {
def `should throw NPE from constructor if null passed`: Unit = {
a [NullPointerException] should be thrownBy {
new OptionalThrowable(null)
}
}
def `should have a properly behaving equals method` {
def `should have a properly behaving equals method`: Unit = {
def1 shouldEqual def1
def1 shouldEqual new OptionalThrowable(ex1)
def2 shouldEqual def2
Expand All @@ -55,12 +55,12 @@ class OptionalThrowableSpec extends UnitSpec {
undef shouldEqual new OptionalThrowable()
undef should not equal def1
}
def `should have a properly behaving hashCode method` {
def `should have a properly behaving hashCode method`: Unit = {
def1.hashCode shouldEqual (new OptionalThrowable(ex1)).hashCode
def2.hashCode shouldEqual (new OptionalThrowable(ex2)).hashCode
undef.hashCode shouldEqual (new OptionalThrowable()).hashCode
}
def `should have a pretty toString` {
def `should have a pretty toString`: Unit = {
def1.toString should (startWith ("OptionalThrowable(") and endWith (")") and not be ("OptionalThrowable()"))
def2.toString should (startWith ("OptionalThrowable(") and endWith (")") and not be ("OptionalThrowable()"))
undef.toString shouldBe "OptionalThrowable()"
Expand Down
6 changes: 3 additions & 3 deletions src/test/scala/sbt/testing/SuiteSelectorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ class SuiteSelectorSpec extends UnitSpec {

object `a SuiteSelector` {
val aSuiteSelector = new SuiteSelector
def `should have a properly behaving equals method` {
def `should have a properly behaving equals method`: Unit = {
aSuiteSelector shouldEqual aSuiteSelector
aSuiteSelector shouldEqual new SuiteSelector
aSuiteSelector should not equal null
aSuiteSelector should not equal "howdy"
aSuiteSelector should not equal new TestSelector("howdy")
}
def `should have a properly behaving hashCode method` {
def `should have a properly behaving hashCode method`: Unit = {
(new SuiteSelector).hashCode shouldEqual (new SuiteSelector).hashCode
}
def `should have a pretty toString` {
def `should have a pretty toString`: Unit = {
aSuiteSelector.toString shouldEqual "SuiteSelector"
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/test/scala/sbt/testing/TaskDefSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class TaskDefSpec extends UnitSpec {
)

object `a TaskDef` {
def `should give back what you put into it` {
def `should give back what you put into it`: Unit = {
td1.fullyQualifiedName shouldBe fqn1
td1.fingerprint shouldBe SuiteSubclassFingerprint
td1.explicitlySpecified shouldBe false
Expand All @@ -44,7 +44,7 @@ class TaskDefSpec extends UnitSpec {
td2.explicitlySpecified shouldBe true
td2.selectors shouldBe Array(new TestSelector("it should do something"))
}
def `should throw NPE from constructor if null passed` {
def `should throw NPE from constructor if null passed`: Unit = {
val fullyQualifiedName: String = "com.myproject.SomeSpec"
val fingerprint: Fingerprint = SuiteSubclassFingerprint
val selectors: Array[Selector] = Array(new SuiteSelector)
Expand All @@ -61,7 +61,7 @@ class TaskDefSpec extends UnitSpec {
}
}
}
def `should have a properly behaving equals method` {
def `should have a properly behaving equals method`: Unit = {
td1 shouldEqual td1
td1 shouldEqual (
new TaskDef(
Expand All @@ -75,7 +75,7 @@ class TaskDefSpec extends UnitSpec {
td1 should not equal "howdy"
td1 should not equal td2
}
def `should have a properly behaving hashCode method` {
def `should have a properly behaving hashCode method`: Unit = {
td1.hashCode shouldEqual td1.hashCode
td1.hashCode shouldEqual (
new TaskDef(
Expand All @@ -96,7 +96,7 @@ class TaskDefSpec extends UnitSpec {
).hashCode
)
}
def `should have a pretty toString` {
def `should have a pretty toString`: Unit = {
td1.toString should startWith ("TaskDef(com.myproject.SomeSpec, ")
td1.toString should endWith (", false, [SuiteSelector])")
td2.toString should startWith ("TaskDef(com.myproject.SomeOtherSpec, ")
Expand Down
10 changes: 5 additions & 5 deletions src/test/scala/sbt/testing/TestSelectorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ class TestSelectorSpec extends UnitSpec {
object `a TestSelector` {
val redTestSelector = new TestSelector("red")
val blueTestSelector = new TestSelector("blue")
def `should give back what you put into it` {
def `should give back what you put into it`: Unit = {
redTestSelector.testName shouldBe "red"
blueTestSelector.testName shouldBe "blue"
}
def `should have a properly behaving equals method` {
def `should have a properly behaving equals method`: Unit = {
redTestSelector shouldEqual redTestSelector
redTestSelector shouldEqual new TestSelector("red")
redTestSelector shouldEqual new TestSelector(red())
Expand All @@ -20,19 +20,19 @@ class TestSelectorSpec extends UnitSpec {
redTestSelector should not equal "howdy"
redTestSelector should not equal new SuiteSelector
}
def `should have a properly behaving hashCode method` {
def `should have a properly behaving hashCode method`: Unit = {
redTestSelector.hashCode shouldEqual redTestSelector.hashCode
redTestSelector.hashCode shouldEqual (new TestSelector("red")).hashCode
redTestSelector.hashCode should not equal blueTestSelector.hashCode
blueTestSelector.hashCode shouldEqual blueTestSelector.hashCode
blueTestSelector.hashCode shouldEqual (new TestSelector("blue")).hashCode
}
def `should throw NPE from constructor if null passed` {
def `should throw NPE from constructor if null passed`: Unit = {
a [NullPointerException] should be thrownBy {
new TestSelector(null)
}
}
def `should have a pretty toString` {
def `should have a pretty toString`: Unit = {
redTestSelector.toString shouldEqual "TestSelector(red)"
blueTestSelector.toString shouldEqual "TestSelector(blue)"
}
Expand Down
10 changes: 5 additions & 5 deletions src/test/scala/sbt/testing/TestWildcardSelectorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ class TestWildcardSelectorSpec extends UnitSpec {
object `a TestWildcardSelector` {
val redTestWildcardSelector = new TestWildcardSelector("red")
val blueTestWildcardSelector = new TestWildcardSelector("blue")
def `should give back what you put into it` {
def `should give back what you put into it`: Unit = {
redTestWildcardSelector.testWildcard shouldBe "red"
blueTestWildcardSelector.testWildcard shouldBe "blue"
}
def `should have a properly behaving equals method` {
def `should have a properly behaving equals method`: Unit = {
redTestWildcardSelector shouldEqual redTestWildcardSelector
redTestWildcardSelector shouldEqual new TestWildcardSelector("red")
redTestWildcardSelector shouldEqual new TestWildcardSelector(red())
Expand All @@ -20,19 +20,19 @@ class TestWildcardSelectorSpec extends UnitSpec {
redTestWildcardSelector should not equal "howdy"
redTestWildcardSelector should not equal new SuiteSelector
}
def `should have a properly behaving hashCode method` {
def `should have a properly behaving hashCode method`: Unit = {
redTestWildcardSelector.hashCode shouldEqual redTestWildcardSelector.hashCode
redTestWildcardSelector.hashCode shouldEqual (new TestWildcardSelector("red")).hashCode
redTestWildcardSelector.hashCode should not equal blueTestWildcardSelector.hashCode
blueTestWildcardSelector.hashCode shouldEqual blueTestWildcardSelector.hashCode
blueTestWildcardSelector.hashCode shouldEqual (new TestWildcardSelector("blue")).hashCode
}
def `should throw NPE from constructor if null passed` {
def `should throw NPE from constructor if null passed`: Unit = {
a [NullPointerException] should be thrownBy {
new TestWildcardSelector(null)
}
}
def `should have a pretty toString` {
def `should have a pretty toString`: Unit = {
redTestWildcardSelector.toString shouldEqual "TestWildcardSelector(red)"
blueTestWildcardSelector.toString shouldEqual "TestWildcardSelector(blue)"
}
Expand Down

0 comments on commit e0db1f5

Please sign in to comment.