blob: 427bef0bd676cad2e10c7cccbd3334c85f46aa7a [file] [log] [blame]
// Copyright (c) 2021, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.diagnosticinspector;
import static com.android.tools.r8.DiagnosticsMatcher.diagnosticType;
import static org.hamcrest.MatcherAssert.assertThat;
import com.android.tools.r8.Diagnostic;
import com.android.tools.r8.diagnostic.MissingDefinitionsDiagnostic;
public class FoundDiagnosticSubject<D extends Diagnostic> implements DiagnosticSubject {
private final D diagnostic;
public FoundDiagnosticSubject(D diagnostic) {
this.diagnostic = diagnostic;
}
public D getDiagnostic() {
return diagnostic;
}
@Override
public FoundMissingDefinitionsDiagnosticSubject assertIsMissingDefinitionsDiagnostic() {
assertThat(diagnostic, diagnosticType(MissingDefinitionsDiagnostic.class));
return new FoundMissingDefinitionsDiagnosticSubject((MissingDefinitionsDiagnostic) diagnostic);
}
}