@@ -149,19 +149,19 @@ sealed abstract class Prop extends Serializable { self =>
149
149
override def toString = " Prop"
150
150
151
151
/** Put a label on the property to make test reports clearer */
152
- def label (l : String ) = map(_.label(l))
152
+ def label (l : => String ) = map(_.label(l))
153
153
154
154
/** Put a label on the property to make test reports clearer */
155
- def :| (l : String ) = label(l)
155
+ def :| (l : => String ) = label(l)
156
156
157
157
/** Put a label on the property to make test reports clearer */
158
- def |: (l : String ) = label(l)
158
+ def |: (l : => String ) = label(l)
159
159
160
160
/** Put a label on the property to make test reports clearer */
161
- def :| (l : Symbol ) = label(l.name)
161
+ def :| (l : => Symbol )( implicit d : DummyImplicit ) = label(l.name)
162
162
163
163
/** Put a label on the property to make test reports clearer */
164
- def |: (l : Symbol ) = label(l.name)
164
+ def |: (l : => Symbol )( implicit d : DummyImplicit ) = label(l.name)
165
165
166
166
}
167
167
@@ -214,7 +214,10 @@ object Prop {
214
214
215
215
def collect (x : Any ) = copy(collected = collected + x)
216
216
217
- def label (l : String ) = copy(labels = labels + (() => l))
217
+ def label (l : => String ) = {
218
+ lazy val label = l
219
+ copy(labels = labels + (() => label))
220
+ }
218
221
219
222
def && (r : Result ) = (this .status, r.status) match {
220
223
case (Exception (_), _) => this
0 commit comments