Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
a34d1bdf
Commit
a34d1bdf
authored
Aug 14, 2020
by
aniket-engg
Committed by
Aniket
Aug 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notequal uint done
parent
61047655
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
4 deletions
+46
-4
tests.sol.ts
libs/remix-tests/sol/tests.sol.ts
+2
-2
assert_equal_test.sol
libs/remix-tests/tests/examples_0/assert_equal_test.sol
+1
-1
assert_notEqual_test.sol
libs/remix-tests/tests/examples_0/assert_notEqual_test.sol
+13
-0
assert_ok_test.sol
libs/remix-tests/tests/examples_0/assert_ok_test.sol
+1
-1
testRunner.spec.ts
libs/remix-tests/tests/testRunner.spec.ts
+29
-0
No files found.
libs/remix-tests/sol/tests.sol.ts
View file @
a34d1bdf
...
@@ -62,9 +62,9 @@ library Assert {
...
@@ -62,9 +62,9 @@ library Assert {
emit AssertionEvent(result, message);
emit AssertionEvent(result, message);
}
}
function notEqual(uint
a, uint
b, string memory message) public returns (bool result) {
function notEqual(uint
256 a, uint256
b, string memory message) public returns (bool result) {
result = (a != b);
result = (a != b);
emit AssertionEvent
(result, message
);
emit AssertionEvent
Uint(result, message, a, b
);
}
}
function notEqual(int a, int b, string memory message) public returns (bool result) {
function notEqual(int a, int b, string memory message) public returns (bool result) {
...
...
libs/remix-tests/tests/examples_0/assert_equal_test.sol
View file @
a34d1bdf
...
@@ -3,7 +3,7 @@ import "remix_tests.sol"; // this import is automatically injected by Remix.
...
@@ -3,7 +3,7 @@ import "remix_tests.sol"; // this import is automatically injected by Remix.
contract AssertEqualTest {
contract AssertEqualTest {
function equalUintPassTest() public {
function equalUintPassTest() public {
Assert.equal(uint(1), uint(1), "equalUintPassTest
fail
s");
Assert.equal(uint(1), uint(1), "equalUintPassTest
passe
s");
}
}
function equalUintFailTest() public {
function equalUintFailTest() public {
...
...
libs/remix-tests/tests/examples_0/assert_notEqual_test.sol
0 → 100644
View file @
a34d1bdf
import "remix_tests.sol"; // this import is automatically injected by Remix.
contract AssertNotEqualTest {
function notEqualUintPassTest() public {
Assert.notEqual(uint(1), uint(2), "notEqualUintPassTest passes");
}
function notEqualUintFailTest() public {
Assert.notEqual(uint(1), uint(1), "notEqualUintFailTest fails");
}
}
\ No newline at end of file
libs/remix-tests/tests/examples_0/assert_ok_test.sol
View file @
a34d1bdf
...
@@ -3,7 +3,7 @@ import "remix_tests.sol"; // this import is automatically injected by Remix.
...
@@ -3,7 +3,7 @@ import "remix_tests.sol"; // this import is automatically injected by Remix.
contract AssertOkTest {
contract AssertOkTest {
function okPassTest() public {
function okPassTest() public {
Assert.ok(true, "okPassTest
fail
s");
Assert.ok(true, "okPassTest
passe
s");
}
}
function okFailTest() public {
function okFailTest() public {
...
...
libs/remix-tests/tests/testRunner.spec.ts
View file @
a34d1bdf
...
@@ -160,6 +160,35 @@ describe('testRunner', () => {
...
@@ -160,6 +160,35 @@ describe('testRunner', () => {
})
})
})
})
describe
(
'assert library NOTEQUAL method tests'
,
()
=>
{
const
filename
:
string
=
__dirname
+
'/examples_0/assert_notEqual_test.sol'
beforeAll
((
done
)
=>
{
compileAndDeploy
(
filename
,
(
_err
:
Error
|
null
|
undefined
,
compilationData
:
object
,
contracts
:
any
,
asts
:
any
,
accounts
:
string
[])
=>
{
runTest
(
'AssertNotEqualTest'
,
contracts
.
AssertNotEqualTest
,
compilationData
[
filename
][
'AssertNotEqualTest'
],
asts
[
filename
],
{
accounts
},
testCallback
,
resultsCallback
(
done
))
})
})
afterAll
(()
=>
{
tests
=
[]
})
it
(
'should have 1 passing test'
,
()
=>
{
assert
.
equal
(
results
.
passingNum
,
1
)
})
it
(
'should have 1 failing test'
,
()
=>
{
assert
.
equal
(
results
.
failureNum
,
1
)
})
it
(
'should return'
,
()
=>
{
deepEqualExcluding
(
tests
,
[
{
type
:
'accountList'
,
value
:
accounts
},
{
type
:
'contract'
,
value
:
'AssertNotEqualTest'
,
filename
:
__dirname
+
'/examples_0/assert_notEqual_test.sol'
},
{
type
:
'testPass'
,
value
:
'Not equal uint pass test'
,
context
:
'AssertNotEqualTest'
},
{
type
:
'testFailure'
,
value
:
'Not equal uint fail test'
,
errMsg
:
'notEqualUintFailTest fails'
,
context
:
'AssertNotEqualTest'
,
expected
:
'1'
,
returned
:
'1'
}
],
[
'time'
])
})
})
describe
(
'test with beforeAll'
,
()
=>
{
describe
(
'test with beforeAll'
,
()
=>
{
const
filename
:
string
=
__dirname
+
'/examples_1/simple_storage_test.sol'
const
filename
:
string
=
__dirname
+
'/examples_1/simple_storage_test.sol'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment