infrastructure-upgrade/lib/openzeppelin-contracts/test/utils/EnumerableSet.test.js
T-Hax 735546619e
init
Signed-off-by: T-Hax <>
2023-04-08 18:46:18 +00:00

34 lines
1001 B
JavaScript

const { accounts, contract } = require('@openzeppelin/test-environment');
const { BN } = require('@openzeppelin/test-helpers');
const EnumerableAddressSetMock = contract.fromArtifact('EnumerableAddressSetMock');
const EnumerableUintSetMock = contract.fromArtifact('EnumerableUintSetMock');
const { shouldBehaveLikeSet } = require('./EnumerableSet.behavior');
describe('EnumerableSet', function () {
// AddressSet
describe('EnumerableAddressSet', function () {
const [ accountA, accountB, accountC ] = accounts;
beforeEach(async function () {
this.set = await EnumerableAddressSetMock.new();
});
shouldBehaveLikeSet(accountA, accountB, accountC);
});
// UintSet
describe('EnumerableUintSet', function () {
const uintA = new BN('1234');
const uintB = new BN('5678');
const uintC = new BN('9101112');
beforeEach(async function () {
this.set = await EnumerableUintSetMock.new();
});
shouldBehaveLikeSet(uintA, uintB, uintC);
});
});