Trying to get basic Solidity unit tests working ala http://truffleframework.com/docs/getting_started/solidity-tests but the simplest assert fails compilation
`pragma solidity ^0.4.17;
import "truffle/Assert.sol";
import "truffle/DeployedAddresses.sol";
import "../../contracts/HotokenReservation.sol";
contract TestHotokenReservationMath
{
function testSanity() public
{
Assert.equal(1,1,"One is One.");
}
}`
trying to run unit tests results in:
,/home/scherrey/projects/languages/hotoken/test/SolTests/TestHotokenReservationMath.sol:11:9: TypeError: Member "equal" not unique after argument-dependent lookup in type(library Assert)
Assert.equal(1,1,"One is One.");
^----------^
Compilation failed. See above.
npm ERR! Test failed. See above for more details.
Unit test should compile & pass.
`scherrey@satriani:~/projects/languages/hotoken$ npm test
[email protected] test /home/scherrey/projects/languages/hotoken
truffle test
Using network 'development'.
Compiling ./contracts/HotokenReservation.sol...
Compiling ./contracts/math/SafeMath.sol...
Compiling ./contracts/ownership/Ownable.sol...
Compiling ./contracts/token/BasicToken.sol...
Compiling ./contracts/token/ERC20.sol...
Compiling ./contracts/token/ERC20Basic.sol...
Compiling ./contracts/token/StandardToken.sol...
Compiling ./contracts/utils/strings.sol...
Compiling ./test/SolTests/TestHotokenReservationMath.sol...
Compiling truffle/Assert.sol...
Compiling truffle/DeployedAddresses.sol...
Compilation warnings encountered:
/home/scherrey/projects/languages/hotoken/contracts/HotokenReservation.sol:246:13: Warning: Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning.
Ledger ledger = ledgerMap[_address][i];
^-----------^
,/home/scherrey/projects/languages/hotoken/contracts/utils/strings.sol:474:21: Warning: Jump instructions are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch" or "for" statements instead.
jumpi(exit, eq(and(mload(ptr), mask), needledata))
^---^
,/home/scherrey/projects/languages/hotoken/contracts/utils/strings.sol:476:21: Warning: Jump instructions are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch" or "for" statements instead.
jumpi(loop, lt(sub(ptr, 1), end))
^---^
,/home/scherrey/projects/languages/hotoken/contracts/utils/strings.sol:511:21: Warning: Jump instructions are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch" or "for" statements instead.
jumpi(ret, eq(and(mload(ptr), mask), needledata))
^---^
,/home/scherrey/projects/languages/hotoken/contracts/utils/strings.sol:513:21: Warning: Jump instructions are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch" or "for" statements instead.
jumpi(loop, gt(add(ptr, 1), selfptr))
^---^
,/home/scherrey/projects/languages/hotoken/contracts/utils/strings.sol:515:21: Warning: Jump instructions are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch" or "for" statements instead.
jump(exit)
^--^
/home/scherrey/projects/languages/hotoken/contracts/HotokenReservation.sol:246:13: Warning: Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning.
Ledger ledger = ledgerMap[_address][i];
^-----------^
,/home/scherrey/projects/languages/hotoken/contracts/utils/strings.sol:474:21: Warning: Jump instructions are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch" or "for" statements instead.
jumpi(exit, eq(and(mload(ptr), mask), needledata))
^---^
,/home/scherrey/projects/languages/hotoken/contracts/utils/strings.sol:476:21: Warning: Jump instructions are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch" or "for" statements instead.
jumpi(loop, lt(sub(ptr, 1), end))
^---^
,/home/scherrey/projects/languages/hotoken/contracts/utils/strings.sol:511:21: Warning: Jump instructions are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch" or "for" statements instead.
jumpi(ret, eq(and(mload(ptr), mask), needledata))
^---^
,/home/scherrey/projects/languages/hotoken/contracts/utils/strings.sol:513:21: Warning: Jump instructions are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch" or "for" statements instead.
jumpi(loop, gt(add(ptr, 1), selfptr))
^---^
,/home/scherrey/projects/languages/hotoken/contracts/utils/strings.sol:515:21: Warning: Jump instructions are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch" or "for" statements instead.
jump(exit)
^--^
,/home/scherrey/projects/languages/hotoken/test/SolTests/TestHotokenReservationMath.sol:11:9: TypeError: Member "equal" not unique after argument-dependent lookup in type(library Assert)
Assert.equal(1,1,"One is One.");
^----------^
Compilation failed. See above.
npm ERR! Test failed. See above for more details.
scherrey@satriani:~/projects/languages/hotoken$ git status
On branch solidity_unit_test
Your branch is up-to-date with 'origin/solidity_unit_test'.
nothing to commit, working directory clean
scherrey@satriani:~/projects/languages/hotoken$`
As the error message suggest it, it's a method overloading issue.
Being more specific about the types allows Solidity to pick exactly one equal implementation:
Assert.equal(uint(1), uint(1), "One is One.");
That fixes it. Thanx!
Similar problem is faced with string
We have to use bytes32 instead.
Unfortunately, uint32 doesn't work!
The solution above did not work when using bytes
@scherrey requesting to reopen this

It works when I use uint(X), but doesn't work when I use uint8(X). Is there ambiguity between uint8 and bytes?
Most helpful comment
As the error message suggest it, it's a method overloading issue.
Being more specific about the types allows Solidity to pick exactly one
equalimplementation: