@@ -728,12 +728,10 @@ func Diagnostics(filters ...DiagnosticFilter) Expectation {
728
728
}
729
729
}
730
730
731
- // NoMatchingDiagnostics asserts that there are no diagnostics matching the
732
- // given filters. Notably, if no filters are supplied this assertion checks
733
- // that there are no diagnostics at all, for any file.
734
- //
735
- // TODO(rfindley): replace NoDiagnostics with this, and rename.
736
- func NoMatchingDiagnostics (filters ... DiagnosticFilter ) Expectation {
731
+ // NoDiagnostics asserts that there are no diagnostics matching the given
732
+ // filters. Notably, if no filters are supplied this assertion checks that
733
+ // there are no diagnostics at all, for any file.
734
+ func NoDiagnostics (filters ... DiagnosticFilter ) Expectation {
737
735
check := func (s State ) Verdict {
738
736
diags := flattenDiagnostics (s )
739
737
for _ , filter := range filters {
@@ -778,7 +776,7 @@ func flattenDiagnostics(state State) []flatDiagnostic {
778
776
// -- Diagnostic filters --
779
777
780
778
// A DiagnosticFilter filters the set of diagnostics, for assertion with
781
- // Diagnostics or NoMatchingDiagnostics .
779
+ // Diagnostics or NoDiagnostics .
782
780
type DiagnosticFilter struct {
783
781
desc string
784
782
check func (name string , _ protocol.Diagnostic ) bool
@@ -832,21 +830,6 @@ func WithMessageContaining(substring string) DiagnosticFilter {
832
830
833
831
// TODO(rfindley): eliminate all expectations below this point.
834
832
835
- // NoDiagnostics asserts that either no diagnostics are sent for the
836
- // workspace-relative path name, or empty diagnostics are sent.
837
- func NoDiagnostics (name string ) Expectation {
838
- check := func (s State ) Verdict {
839
- if diags := s .diagnostics [name ]; diags == nil || len (diags .Diagnostics ) == 0 {
840
- return Met
841
- }
842
- return Unmet
843
- }
844
- return SimpleExpectation {
845
- check : check ,
846
- description : fmt .Sprintf ("empty or no diagnostics for %q" , name ),
847
- }
848
- }
849
-
850
833
// DiagnosticAtRegexp expects that there is a diagnostic entry at the start
851
834
// position matching the regexp search string re in the buffer specified by
852
835
// name. Note that this currently ignores the end position.
0 commit comments