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
fb440d1f
Commit
fb440d1f
authored
Jan 19, 2021
by
aniket-engg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tests
parent
a6b0e140
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
5 deletions
+34
-5
testRunner.cli.spec.ts
libs/remix-tests/tests/testRunner.cli.spec.ts
+34
-5
No files found.
libs/remix-tests/tests/testRunner.cli.spec.ts
View file @
fb440d1f
...
@@ -45,7 +45,7 @@ Commands:
...
@@ -45,7 +45,7 @@ Commands:
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/AssertOkTest/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/AssertOkTest/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok pass test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok pass test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok fail test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok fail test/
)
// ma
ct
h fail test details
// ma
tc
h fail test details
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/expected value to be ok to: true/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/expected value to be ok to: true/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/returned: false/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/returned: false/
)
...
@@ -61,10 +61,16 @@ Commands:
...
@@ -61,10 +61,16 @@ Commands:
// match test result
// match test result
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok pass test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok pass test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok fail test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok fail test/
)
// ma
ct
h fail test details
// ma
tc
h fail test details
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
})
})
test
(
'remix-tests running a test file with unavailable custom compiler version (should fail)'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
'--compiler'
,
'1.10.4'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
// match initial lines
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'No compiler found in releases with version 1.10.4'
)).
toBeTruthy
()
})
test
(
'remix-tests running a test file with custom EVM'
,
()
=>
{
test
(
'remix-tests running a test file with custom EVM'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
'--evm'
,
'petersburg'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
const
res
=
spawnSync
(
executablePath
,
[
'--evm'
,
'petersburg'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
// match initial lines
// match initial lines
...
@@ -74,7 +80,7 @@ Commands:
...
@@ -74,7 +80,7 @@ Commands:
// match test result
// match test result
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok pass test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok pass test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok fail test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok fail test/
)
// ma
ct
h fail test details
// ma
tc
h fail test details
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
})
})
...
@@ -87,7 +93,7 @@ Commands:
...
@@ -87,7 +93,7 @@ Commands:
// match test result
// match test result
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok pass test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok pass test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok fail test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok fail test/
)
// ma
ct
h fail test details
// ma
tc
h fail test details
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
})
})
...
@@ -101,7 +107,30 @@ Commands:
...
@@ -101,7 +107,30 @@ Commands:
// match test result
// match test result
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok pass test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok pass test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok fail test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok fail test/
)
// macth fail test details
// match fail test details
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
})
test
(
'remix-tests running a test file without enabling optimization and setting runs (should fail)'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
'--runs'
,
'300'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
// match initial lines
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Optimization should be enabled for runs'
)).
toBeTruthy
()
})
test
(
'remix-tests running a test file with all options'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
'--compiler'
,
'0.7.5'
,
'--evm'
,
'istanbul'
,
'--optimize'
,
'true'
,
'--runs'
,
'250'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
// match initial lines
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Compiler version set to 0.7.5. Latest version is'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Loading remote solc version v0.7.5+commit.eb77ed08 ...'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'EVM set to istanbul'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Optimization is enabled'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Runs set to 250'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/:: Running remix-tests - Unit testing for solidity ::/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/creation of library remix_tests.sol:Assert pending.../
)
// match test result
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok pass test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok fail test/
)
// match fail test details
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
})
})
})
})
...
...
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