Merge "Add AssertSame" am: c14e8aa6a8

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1640333

Change-Id: Ifb97e8ff4ba7e0e9437d7309d4e7711851a1a6de
This commit is contained in:
Paul Duffin
2021-03-18 08:56:38 +00:00
committed by Automerger Merge Worker

View File

@@ -22,6 +22,15 @@ import (
// This file contains general purpose test assert functions.
// AssertSame checks if the expected and actual values are equal and if they are not then
// it reports an error prefixed with the supplied message and including a reason for why it failed.
func AssertSame(t *testing.T, message string, expected interface{}, actual interface{}) {
t.Helper()
if actual != expected {
t.Errorf("%s: expected:\n%#v\nactual:\n%#v", message, expected, actual)
}
}
// AssertBoolEquals checks if the expected and actual values are equal and if they are not then it
// reports an error prefixed with the supplied message and including a reason for why it failed.
func AssertBoolEquals(t *testing.T, message string, expected bool, actual bool) {