Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

接口

interface AssertPrintable

public interface AssertPrintable<T> {
    prop hasNestedDiff: Bool
    func pprintForAssertion(
        pp: PrettyPrinter, that: T, thisPrefix: String, thatPrefix: String, level: Int64
    ): PrettyPrinter
}

功能:提供打印 @Assert/@Expect 的检查结果的方法。

prop hasNestedDiff

prop hasNestedDiff: Bool

功能:获取是否有嵌套 diff 层级。

类型:Bool

func pprintForAssertion(PrettyPrinter, T, String, String, Int64)

func pprintForAssertion(
    pp: PrettyPrinter, that: T, thisPrefix: String, thatPrefix: String, level: Int64
): PrettyPrinter

功能:打印 @Assert/@Expect 的检查结果的方法。

参数:

  • pp: PrettyPrinter - 打印器。
  • that: T - 待打印的信息。
  • thisPrefix: String - 预期内容的前缀。
  • thatPrefix: String - 实际内容的前缀。
  • level: Int64 - 嵌套层级。

返回值:

  • PrettyPrinter - 打印器。

extend Float16 <: AssertPrintable<Float16>

extend Float16 <: AssertPrintable<Float16>

功能:对 Float16 的扩展。

prop hasNestedDiff

public prop hasNestedDiff: Bool

功能:获取是否有嵌套 diff 层级。

类型:Bool

func pprintForAssertion(PrettyPrinter, Float16, String, String, Int64)

public func pprintForAssertion(
    pp: PrettyPrinter, that: Float16, thisPrefix: String, thatPrefix: String, level: Int64
): PrettyPrinter

功能:打印 @Assert/@Expect 的检查结果的方法。

参数:

  • pp: PrettyPrinter - 打印器。
  • that: Float16 - 待打印的信息。
  • thisPrefix: String - 预期内容的前缀。
  • thatPrefix: String - 实际内容的前缀。
  • level: Int64 - 嵌套层级。

返回值:

  • PrettyPrinter - 打印器。

extend Float32 <: AssertPrintable<Float32>

extend Float32  <: AssertPrintable<Float32>

功能:对 Float32 的扩展。

prop hasNestedDiff

public prop hasNestedDiff: Bool

功能:获取是否有嵌套 diff 层级。

类型:Bool

func pprintForAssertion(PrettyPrinter, Float32, String, String, Int64)

public func pprintForAssertion(
    pp: PrettyPrinter, that: Float32, thisPrefix: String, thatPrefix: String, level: Int64
): PrettyPrinter

功能:打印 @Assert/@Expect 的检查结果的方法。

参数:

  • pp: PrettyPrinter - 打印器。
  • that: Float32 - 待打印的信息。
  • thisPrefix: String - 预期内容的前缀。
  • thatPrefix: String - 实际内容的前缀。
  • level: Int64 - 嵌套层级。

返回值:

  • PrettyPrinter - 打印器。

extend Float64 <: AssertPrintable<Float64>

extend Float64 <: AssertPrintable<Float64>

功能:对 Float64 的扩展。

prop hasNestedDiff

public prop hasNestedDiff: Bool

功能:获取是否有嵌套 diff 层级。

类型:Bool

func pprintForAssertion(PrettyPrinter, Float64, String, String, Int64)

public func pprintForAssertion(
    pp: PrettyPrinter, that: Float64, thisPrefix: String, thatPrefix: String, level: Int64
): PrettyPrinter

功能:打印 @Assert/@Expect 的检查结果的方法。

参数:

  • pp: PrettyPrinter - 打印器。
  • that: Float64 - 待打印的信息。
  • thisPrefix: String - 预期内容的前缀。
  • thatPrefix: String - 实际内容的前缀。
  • level: Int64 - 嵌套层级。

返回值:

  • PrettyPrinter - 打印器。

extend<T> Option<T> <: AssertPrintable<Option<T>> where T <: Equatable<T>

extend<T> Option<T> <: AssertPrintable<Option<T>> where T <: Equatable<T> 

功能:对 Option<T> 的扩展。

prop hasNestedDiff

public prop hasNestedDiff: Bool

功能:获取是否有嵌套 diff 层级。

类型:Bool

func pprintForAssertion(PrettyPrinter, Option<T>, String, String, Int64)

public func pprintForAssertion(
    pp: PrettyPrinter, that:  Option<T>, thisPrefix: String, thatPrefix: String, level: Int64
): PrettyPrinter

功能:打印 @Assert/@Expect 的检查结果的方法。

参数:

  • pp: PrettyPrinter - 打印器。
  • that: Option<T> - 待打印的信息。
  • thisPrefix: String - 预期内容的前缀。
  • thatPrefix: String - 实际内容的前缀。
  • level: Int64 - 嵌套层级。

返回值:

  • PrettyPrinter - 打印器。

extend String <: AssertPrintable<String>

extend String <: AssertPrintable<String>

功能:对 String 的扩展。

prop hasNestedDiff

public prop hasNestedDiff: Bool

功能:获取是否有嵌套 diff 层级。

类型:Bool

func pprintForAssertion(PrettyPrinter, String, String, String, Int64)

public func pprintForAssertion(
    pp: PrettyPrinter, that: String, thisPrefix: String, thatPrefix: String, level: Int64
): PrettyPrinter

功能:打印 @Assert/@Expect 的检查结果的方法。

参数:

  • pp: PrettyPrinter - 打印器。
  • that: String - 待打印的信息。
  • thisPrefix: String - 预期内容的前缀。
  • thatPrefix: String - 实际内容的前缀。
  • level: Int64 - 嵌套层级。

返回值:

  • PrettyPrinter - 打印器。