assertEq

签名

bool

function assertEq(bool left, bool right) internal;
function assertEq(bool left, bool right, string memory err) internal;

uint256

function assertEq(uint256 left, uint256 right) internal;
function assertEq(uint256 left, uint256 right, string memory err) internal;

int256

function assertEq(int256 left, int256 right) internal;
function assertEq(int256 left, int256 right, string memory err) internal;

address

function assertEq(address left, address right) internal;
function assertEq(address left, address right, string memory err) internal;

bytes32

function assertEq(bytes32 left, bytes32 right) internal;
function assertEq(bytes32 left, bytes32 right, string memory err) internal;

string

function assertEq(string memory left, string memory right) internal;
function assertEq(string memory left, string memory right, string memory err) internal;

bytes

function assertEq(bytes memory left, bytes memory right) internal;
function assertEq(bytes memory left, bytes memory right, string memory err) internal;

bool[]

function assertEq(bool[] memory left, bool[] memory right) internal;
function assertEq(bool[] memory left, bool[] memory right, string memory err) internal;

uint256[]

function assertEq(uint256[] memory left, uint256[] memory right) internal;
function assertEq(uint256[] memory left, uint256[] memory right, string memory err) internal;

int256[]

function assertEq(int256[] memory left, int256[] memory right) internal;
function assertEq(int256[] memory left, int256[] memory right, string memory err) internal;

address[]

function assertEq(address[] memory left, address[] memory right) internal;
function assertEq(address[] memory left, address[] memory right, string memory err) internal;

bytes32[]

function assertEq(bytes32[] memory left, bytes32[] memory right) internal;
function assertEq(bytes32[] memory left, bytes32[] memory right, string memory err) internal;

string[]

function assertEq(string[] memory left, string[] memory right) internal;
function assertEq(string[] memory left, string[] memory right, string memory err) internal;

bytes[]

function assertEq(bytes[] memory left, bytes[] memory right) internal;
function assertEq(bytes[] memory left, bytes[] memory right, string memory err) internal;

已过时

// 已过时的用于断言两个小于 256 位的 uint:`assertEqUint(uint8(1), uint128(1));`
function assertEqUint(uint256 a, uint256 b) internal;
function assertEq32(bytes32 left, bytes32 right) internal;
function assertEq32(bytes32 left, bytes32 right, string memory err) internal;

描述

断言 left 等于 right

可选地在回退字符串中包含错误消息。

参见