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
bbf72ccb
Commit
bbf72ccb
authored
Aug 14, 2020
by
aniket-engg
Committed by
Aniket
Aug 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greater than uint done
parent
a34d1bdf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
2 deletions
+44
-2
tests.sol.ts
libs/remix-tests/sol/tests.sol.ts
+2
-2
assert_greaterThan_test.sol
.../remix-tests/tests/examples_0/assert_greaterThan_test.sol
+13
-0
testRunner.spec.ts
libs/remix-tests/tests/testRunner.spec.ts
+29
-0
No files found.
libs/remix-tests/sol/tests.sol.ts
View file @
bbf72ccb
...
@@ -105,9 +105,9 @@ library Assert {
...
@@ -105,9 +105,9 @@ library Assert {
}
}
/*----------------- Greater than --------------------*/
/*----------------- Greater than --------------------*/
function greaterThan(uint
a, uint
b, string memory message) public returns (bool result) {
function greaterThan(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 greaterThan(int a, int b, string memory message) public returns (bool result) {
function greaterThan(int a, int b, string memory message) public returns (bool result) {
...
...
libs/remix-tests/tests/examples_0/assert_greaterThan_test.sol
0 → 100644
View file @
bbf72ccb
import "remix_tests.sol"; // this import is automatically injected by Remix.
contract AssertGreaterThanTest {
function greaterThanUintPassTest() public {
Assert.greaterThan(uint(5), uint(2), "greaterThanUintPassTest passes");
}
function greaterThanUintFailTest() public {
Assert.greaterThan(uint(1), uint(4), "greaterThanUintFailTest fails");
}
}
\ No newline at end of file
libs/remix-tests/tests/testRunner.spec.ts
View file @
bbf72ccb
...
@@ -189,6 +189,35 @@ describe('testRunner', () => {
...
@@ -189,6 +189,35 @@ describe('testRunner', () => {
})
})
})
})
describe
(
'assert library GREATERTHAN method tests'
,
()
=>
{
const
filename
:
string
=
__dirname
+
'/examples_0/assert_greaterThan_test.sol'
beforeAll
((
done
)
=>
{
compileAndDeploy
(
filename
,
(
_err
:
Error
|
null
|
undefined
,
compilationData
:
object
,
contracts
:
any
,
asts
:
any
,
accounts
:
string
[])
=>
{
runTest
(
'AssertGreaterThanTest'
,
contracts
.
AssertGreaterThanTest
,
compilationData
[
filename
][
'AssertGreaterThanTest'
],
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
:
'AssertGreaterThanTest'
,
filename
:
__dirname
+
'/examples_0/assert_greaterThan_test.sol'
},
{
type
:
'testPass'
,
value
:
'Greater than uint pass test'
,
context
:
'AssertGreaterThanTest'
},
{
type
:
'testFailure'
,
value
:
'Greater than uint fail test'
,
errMsg
:
'greaterThanUintFailTest fails'
,
context
:
'AssertGreaterThanTest'
,
expected
:
'4'
,
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