Bool
companion object that provides factory methods to create different sub types of Bool
Bool
is used by code generated from BooleanMacro
(which AssertionsMacro
and RequirementsMacro
uses),
it needs to be public so that the generated code can be compiled. It is expected that ScalaTest users would ever need to use Bool
directly.
- Companion:
- class
- Source:
- Bool.scala
Value members
Concrete methods
Create binary macro Bool
that is used by BooleanMacro
to wrap a recognized Boolean
expression, which includes Boolean
expression that
uses ==
, ===
, !=
, !==
, >
, >=
, <
, <=
, &&
,
&
, ||
and |
.
Create binary macro Bool
that is used by BooleanMacro
to wrap a recognized Boolean
expression, which includes Boolean
expression that
uses ==
, ===
, !=
, !==
, >
, >=
, <
, <=
, &&
,
&
, ||
and |
.
- Value parameters:
- expression
the
Boolean
expression- left
the left-hand-side (LHS) of the
Boolean
expression- operator
the operator (method name) of the
Boolean
expression- prettifier
the
Prettifier
used for prettifying messages, this need to be implicit to let the compiler resolve it implicitly, it will be too tricky for our macro to resolve it and pass it over explicitly.- right
the right-hand-side (RHS) of the
Boolean
expression
- Returns:
a binary macro
Bool
- Source:
- Bool.scala
Overloaded method that takes a Bool
in place of Boolean
expression to create a new binary macro Bool
.
Overloaded method that takes a Bool
in place of Boolean
expression to create a new binary macro Bool
.
- Value parameters:
- bool
the
Bool
that will provide theBoolean
expression value withbool.value
- left
the left-hand-side (LHS) of the
Boolean
expression- operator
the operator (method name) of the
Boolean
expression- prettifier
the
Prettifier
used for prettifying messages, this need to be implicit to let the compiler resolve it implicitly, it will be too tricky for our macro to resolve it and pass it over explicitly.- right
the right-hand-side (RHS) of the
Boolean
expression
- Returns:
a binary macro
Bool
- Source:
- Bool.scala
Create exists macro Bool
that is used by BooleanMacro
to wrap a recognized Boolean
expression
represented by exists
method call.
Create exists macro Bool
that is used by BooleanMacro
to wrap a recognized Boolean
expression
represented by exists
method call.
- Value parameters:
- expression
the
Boolean
expression- left
the left-hand-side (LHS) of the
Boolean
expression- prettifier
the
Prettifier
used for prettifying messages, this need to be implicit to let the compiler resolve it implicitly, it will be too tricky for our macro to resolve it and pass it over explicitly.- right
the right-hand-side (RHS) of the
Boolean
expression
- Returns:
a exists macro
Bool
- Source:
- Bool.scala
Create macro Bool
that is used by BooleanMacro
to wrap a recognized Boolean
expression
represented by a isInstanceOf
method call,
Create macro Bool
that is used by BooleanMacro
to wrap a recognized Boolean
expression
represented by a isInstanceOf
method call,
- Value parameters:
- className
the class name passed to
isInstanceOf
method call- expression
the
Boolean
expression- left
the left-hand-side (LHS) of the
Boolean
expression- operator
the operator (method name) of the
Boolean
expression- prettifier
the
Prettifier
used for prettifying messages, this need to be implicit to let the compiler resolve it implicitly, it will be too tricky for our macro to resolve it and pass it over explicitly.
- Returns:
a
Bool
instance that represents aisInstanceOf
method call- Source:
- Bool.scala
Overloaded method that takes a Bool
in place of Boolean
expression to create a new isInstanceOf
macro Bool
.
Overloaded method that takes a Bool
in place of Boolean
expression to create a new isInstanceOf
macro Bool
.
- Value parameters:
- bool
the
Bool
that will provide theBoolean
expression value withbool.value
- className
the class name passed to
isInstanceOf
method call- left
the left-hand-side (LHS) of the
Boolean
expression- operator
the operator (method name) of the
Boolean
expression- prettifier
the
Prettifier
used for prettifying messages, this need to be implicit to let the compiler resolve it implicitly, it will be too tricky for our macro to resolve it and pass it over explicitly.
- Returns:
a
Bool
instance that represents aisInstanceOf
method call- Source:
- Bool.scala
A helper method to check is the given Bool
is a simple macro Bool
and contains empty expression text.
A helper method to check is the given Bool
is a simple macro Bool
and contains empty expression text.
- Value parameters:
- bool
the
Bool
to check
- Returns:
true
if the givenBool
is a simple macroBool
and contains empty expression text,false
otherwise.- Source:
- Bool.scala
Create macro Bool
that is used by BooleanMacro
to wrap a recognized Boolean
expression
represented by length
and size
method call,
Create macro Bool
that is used by BooleanMacro
to wrap a recognized Boolean
expression
represented by length
and size
method call,
- Value parameters:
- actual
the actual value returned from
length
orsize
method call- expected
the expected value returned from
length
orsize
method call- left
the left-hand-side (LHS) of the
Boolean
expression- operator
the operator (method name) of the
Boolean
expression- prettifier
the
Prettifier
used for prettifying messages, this need to be implicit to let the compiler resolve it implicitly, it will be too tricky for our macro to resolve it and pass it over explicitly.
- Returns:
a
Bool
instance that represents alength
orsize
method call- Source:
- Bool.scala
Create a negated version of the given Bool
Create a negated version of the given Bool
- Value parameters:
- bool
the given
Bool
- prettifier
the
Prettifier
used for prettifying messages, this need to be implicit to let the compiler resolve it implicitly, it will be too tricky for our macro to resolve it and pass it over explicitly.
- Returns:
a negated version of the given
Bool
- Source:
- Bool.scala
Create simple macro Bool
that is used by BooleanMacro
to wrap an unrecognized Boolean
expression.
Create simple macro Bool
that is used by BooleanMacro
to wrap an unrecognized Boolean
expression.
- Value parameters:
- expression
the
Boolean
expression- expressionText
the original expression text (source code)
- prettifier
the
Prettifier
used for prettifying messages, this need to be implicit to let the compiler resolve it implicitly, it will be too tricky for our macro to resolve it and pass it over explicitly.
- Returns:
a simple macro
Bool
- Source:
- Bool.scala
Create unary macro Bool
that is used by BooleanMacro
to wrap a recognized Boolean
expression represented by a unary method call,
which includes Boolean
expression that uses isEmpty
.
Create unary macro Bool
that is used by BooleanMacro
to wrap a recognized Boolean
expression represented by a unary method call,
which includes Boolean
expression that uses isEmpty
.
- Value parameters:
- expression
the
Boolean
expression- left
the left-hand-side (LHS) of the
Boolean
expression- operator
the operator (method name) of the
Boolean
expression- prettifier
the
Prettifier
used for prettifying messages, this need to be implicit to let the compiler resolve it implicitly, it will be too tricky for our macro to resolve it and pass it over explicitly.
- Returns:
a unary macro
Bool
- Source:
- Bool.scala
Overloaded method that takes a Bool
in place of Boolean
expression to create a new unary macro Bool
.
Overloaded method that takes a Bool
in place of Boolean
expression to create a new unary macro Bool
.
- Value parameters:
- bool
the
Bool
that will provide theBoolean
expression value withbool.value
- left
the left-hand-side (LHS) of the
Boolean
expression- operator
the operator (method name) of the
Boolean
expression- prettifier
the
Prettifier
used for prettifying messages, this need to be implicit to let the compiler resolve it implicitly, it will be too tricky for our macro to resolve it and pass it over explicitly.
- Returns:
a binary macro
Bool
- Source:
- Bool.scala