expect

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreDiagnosticEquivalent

func AreDiagnosticEquivalent(a protocol.Diagnostic, b protocol.Diagnostic) bool

Compare two diagnostics and indicate if they are equivalents or not Two diagnostics are equivalent if they match all of the following conditions:

  • Same code
  • Same message
  • Same range
  • Same severity

func ListHasDiagnostic

func ListHasDiagnostic(list []protocol.Diagnostic, diagnostic protocol.Diagnostic) bool

Indicate if a diagnostic is present in the given list Will return true if a diagnostic match all the given conditions:

  • Same code
  • Same message
  • Same range
  • Same severity

Types

type Diag

type Diag struct {
	To DiagTo
	// contains filtered or unexported fields
}

func Diagnostic

func Diagnostic(t *testing.T, diagnostic protocol.Diagnostic) Diag

type DiagTo

type DiagTo struct {
	Not DiagToNot
	// contains filtered or unexported fields
}

func (DiagTo) Equal

func (expect DiagTo) Equal(diagnostic protocol.Diagnostic)

type DiagToNot

type DiagToNot struct {
	// contains filtered or unexported fields
}

func (DiagToNot) Equal

func (expect DiagToNot) Equal(diagnostic protocol.Diagnostic)

type ExpectDiagnosticList

type ExpectDiagnosticList struct {
	To To
}

func DiagnosticList

func DiagnosticList(t *testing.T, list []protocol.Diagnostic) ExpectDiagnosticList

type To

type To struct {
	Not ToNot
	Be  ToBe
	// contains filtered or unexported fields
}

func (To) Include

func (expect To) Include(
	diagnostic protocol.Diagnostic,
)

func (To) IncludeAll

func (expect To) IncludeAll(
	diagnostics []protocol.Diagnostic,
)

type ToBe

type ToBe struct {
	// contains filtered or unexported fields
}

func (ToBe) Empty

func (expect ToBe) Empty()

type ToNot

type ToNot struct {
	Be ToNotBe
	// contains filtered or unexported fields
}

func (ToNot) Include

func (expect ToNot) Include(
	diagnostic protocol.Diagnostic,
)

func (ToNot) IncludeAll

func (expect ToNot) IncludeAll(
	val []protocol.Diagnostic,
)

Assert that the given val is not a complete subset of the list

type ToNotBe

type ToNotBe struct {
	// contains filtered or unexported fields
}

func (ToNotBe) Empty

func (expect ToNotBe) Empty()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL