Bool

object Bool

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
class Object
trait Matchable
class Any
Bool.type

Value members

Concrete methods

def binaryMacroBool(left: Any, operator: String, right: Any, expression: Boolean, prettifier: Prettifier): Bool

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
def binaryMacroBool(left: Any, operator: String, right: Any, bool: Bool, prettifier: Prettifier): Bool

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 the Boolean expression value with bool.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
def existsMacroBool(left: Any, right: Any, expression: Boolean, prettifier: Prettifier): Bool

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
def isInstanceOfMacroBool(left: Any, operator: String, className: String, expression: Boolean, prettifier: Prettifier): Bool

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 a isInstanceOf method call

Source:
Bool.scala
def isInstanceOfMacroBool(left: Any, operator: String, className: String, bool: Bool, prettifier: Prettifier): Bool

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 the Boolean expression value with bool.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 a isInstanceOf 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 given Bool is a simple macro Bool and contains empty expression text, false otherwise.

Source:
Bool.scala
def lengthSizeMacroBool(left: Any, operator: String, actual: Any, expected: Any, prettifier: Prettifier): Bool

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 or size method call

expected

the expected value returned from length or size 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 a length or size method call

Source:
Bool.scala
def notBool(bool: Bool, prettifier: Prettifier): Bool

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
def simpleMacroBool(expression: Boolean, expressionText: String, prettifier: Prettifier): Bool

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
def unaryMacroBool(left: Any, operator: String, expression: Boolean, prettifier: Prettifier): Bool

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
def unaryMacroBool(left: Any, operator: String, bool: Bool, prettifier: Prettifier): Bool

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 the Boolean expression value with bool.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