-
Notifications
You must be signed in to change notification settings - Fork 28
/
String.ts
32 lines (24 loc) · 995 Bytes
/
String.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { StringTestInstance } from "../types/truffle-contracts";
import { randomBytes } from "./helper/testUtils";
const StringTest = artifacts.require("StringTest");
contract("String", (accounts) => {
let StringInstance: StringTestInstance;
before(async () => {
StringInstance = await StringTest.new();
});
// Skipped for now due to an issue with the coverage tool.
// The tests pass when run without coverage.
it.skip("can add strings", async () => {
(await StringInstance.add4("1", "2", "3", "4"))
.should.equal("1234");
});
it.skip("can convert addresses to hex strings", async () => {
(await StringInstance.fromAddress(accounts[0]))
.should.equal(accounts[0].toLowerCase());
});
it.skip("can convert bytes32 to hex strings", async () => {
const bytes32 = randomBytes(32);
(await StringInstance.fromBytes32(bytes32))
.should.equal(bytes32.toLowerCase());
});
});