Draft and lifecycles directories cleanup (#2122)
* Move Pausable into utils * Move Strings into utils * Move Counters into utils * Move SignedSafeMath into math * Remove ERC1046 * Make ERC20Snapshot.snapshot internal * Move ERC20Snapshot into ERC20 * Add drafts deprecation notice * Remove drafts directory * Add changelog entry * Apply suggestions from code review Co-Authored-By: Francisco Giordano <frangio.1@gmail.com> Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
26
test/utils/Strings.test.js
Normal file
26
test/utils/Strings.test.js
Normal file
@ -0,0 +1,26 @@
|
||||
const { contract } = require('@openzeppelin/test-environment');
|
||||
const { constants } = require('@openzeppelin/test-helpers');
|
||||
|
||||
const { expect } = require('chai');
|
||||
|
||||
const StringsMock = contract.fromArtifact('StringsMock');
|
||||
|
||||
describe('Strings', function () {
|
||||
beforeEach(async function () {
|
||||
this.strings = await StringsMock.new();
|
||||
});
|
||||
|
||||
describe('from uint256', function () {
|
||||
it('converts 0', async function () {
|
||||
expect(await this.strings.fromUint256(0)).to.equal('0');
|
||||
});
|
||||
|
||||
it('converts a positive number', async function () {
|
||||
expect(await this.strings.fromUint256(4132)).to.equal('4132');
|
||||
});
|
||||
|
||||
it('converts MAX_UINT256', async function () {
|
||||
expect(await this.strings.fromUint256(constants.MAX_UINT256)).to.equal(constants.MAX_UINT256.toString());
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user