Skip to content

Commit 41c2000

Browse files
committed
Merge branch 'prop-config-deprecations-removal' of https://github.com/cheeseng/scalatest into cheeseng-prop-config-deprecations-removal
2 parents 8491f86 + 10b9ec3 commit 41c2000

File tree

5 files changed

+8
-461
lines changed

5 files changed

+8
-461
lines changed

scalatest-test/src/test/scala/org/scalatest/prop/ConfigurationSuite.scala

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,6 @@ class ConfigurationSuite extends FunSuite with Matchers {
3232
minSuccessful(5678).value.value should be (5678)
3333
}
3434

35-
test("maxDiscarded throws IAE if less than 0") {
36-
intercept[IllegalArgumentException] {
37-
maxDiscarded(-1)
38-
}
39-
intercept[IllegalArgumentException] {
40-
maxDiscarded(-2)
41-
}
42-
}
43-
44-
test("maxDiscarded value is passed value, if valid") {
45-
maxDiscarded(0).value should be (0)
46-
maxDiscarded(1).value should be (1)
47-
maxDiscarded(2).value should be (2)
48-
maxDiscarded(5678).value should be (5678)
49-
}
50-
5135
test("maxDiscardedFactor should not compile if less than 0 or a non-double") {
5236
"maxDiscardedFactor(-0.1)" shouldNot compile
5337
"maxDiscardedFactor(-100.0)" shouldNot compile
@@ -73,22 +57,6 @@ class ConfigurationSuite extends FunSuite with Matchers {
7357
minSize(5678).value.value should be (5678)
7458
}
7559

76-
test("maxSize throws IAE if less than 0") {
77-
intercept[IllegalArgumentException] {
78-
maxSize(-1)
79-
}
80-
intercept[IllegalArgumentException] {
81-
maxSize(-2)
82-
}
83-
}
84-
85-
test("maxSize value is passed value, if valid") {
86-
maxSize(0).value should be (0)
87-
maxSize(1).value should be (1)
88-
maxSize(2).value should be (2)
89-
maxSize(5678).value should be (5678)
90-
}
91-
9260
test("sizeRange should not compile if less than 0") {
9361
"sizeRange(-1)" shouldNot compile
9462
"sizeRange(-2)" shouldNot compile

scalatest-test/src/test/scala/org/scalatest/prop/OverrideImplicitConfigurationSuite.scala

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,13 @@ package org.scalatest.prop
33
import org.scalatest._
44

55
trait GetImplicitConfig { self: Configuration =>
6-
def getImplicitConfig()(implicit config: PropertyCheckConfigurable): PropertyCheckConfiguration = config.asPropertyCheckConfiguration
7-
}
8-
9-
class ConfigImplicitOverrideInClassTest extends FunSuite with Matchers with Configuration with GetImplicitConfig {
10-
implicit val classImplicit = PropertyCheckConfig(minSuccessful = 42)
11-
test("config implicit override in class") {
12-
assert(getImplicitConfig().minSuccessful.value == 42)
13-
}
14-
}
15-
16-
class ConfigImplicitOverrideInTestTest extends FunSuite with Matchers with Configuration with GetImplicitConfig {
17-
/*
18-
// Fails to compile:
19-
// could not find implicit value for parameter config: ConfigImplicitOverrideInTestTest.this.PropertyCheckConfiguration
20-
test("config implicit override in test") {
21-
implicit val generatorDrivenConfig = PropertyCheckConfig(minSuccessful = 42)
22-
assert(getImplicitConfig().minSuccessful.value == 42)
23-
}
24-
*/
6+
def getImplicitConfig()(implicit config: PropertyCheckConfiguration): PropertyCheckConfiguration = config
257
}
268

279
class ConfigExplicitOverrideInClass extends FunSuite with Matchers with Configuration with GetImplicitConfig {
2810
// Note: Needs PropertyCheckConfiguration type ascription to compile, otherwise compile failure:
2911
// could not find implicit value for parameter config: ConfigExplicitOverrideInClass.this.PropertyCheckConfiguration
30-
override implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfig(minSuccessful = 42)
12+
override implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 42)
3113
test("config explicit override in class") {
3214
assert(getImplicitConfig().minSuccessful.value == 42)
3315
}

scalatest-test/src/test/scala/org/scalatest/prop/PropertyCheckConfigParamSuite.scala

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,6 @@ class PropertyCheckConfigParamSuite extends FunSuite with Matchers {
4040
MinSuccessful(5678).value.value should be (5678)
4141
}
4242

43-
test("maxDiscarded throws IAE if less than 0") {
44-
intercept[IllegalArgumentException] {
45-
MaxDiscarded(-1)
46-
}
47-
intercept[IllegalArgumentException] {
48-
MaxDiscarded(-2)
49-
}
50-
}
51-
52-
test("maxDiscarded value is passed value, if valid") {
53-
MaxDiscarded(0).value should be (0)
54-
MaxDiscarded(1).value should be (1)
55-
MaxDiscarded(2).value should be (2)
56-
MaxDiscarded(5678).value should be (5678)
57-
}
58-
5943
test("maxDiscardedFactor value is passed value, if valid") {
6044
MaxDiscardedFactor(1.0).value.value should be (1.0)
6145
MaxDiscardedFactor(1.5).value.value should be (1.5)
@@ -78,22 +62,6 @@ class PropertyCheckConfigParamSuite extends FunSuite with Matchers {
7862
MinSize(5678).value.value should be (5678)
7963
}
8064

81-
test("maxSize throws IAE if less than 0") {
82-
intercept[IllegalArgumentException] {
83-
MaxSize(-1)
84-
}
85-
intercept[IllegalArgumentException] {
86-
MaxSize(-2)
87-
}
88-
}
89-
90-
test("maxSize value is passed value, if valid") {
91-
MaxSize(0).value should be (0)
92-
MaxSize(1).value should be (1)
93-
MaxSize(2).value should be (2)
94-
MaxSize(5678).value should be (5678)
95-
}
96-
9765
test("sizeRange should not compile if less than 0") {
9866
"SizeRange(-1)" shouldNot compile
9967
"SizeRange(-2)" shouldNot compile

scalatest-test/src/test/scala/org/scalatest/prop/PropertyCheckConfigSuite.scala

Lines changed: 0 additions & 133 deletions
This file was deleted.

0 commit comments

Comments
 (0)