-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6ba663
commit b6f884e
Showing
10 changed files
with
242 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
use predicates::prelude::*; | ||
|
||
use crate::common; | ||
|
||
#[test] | ||
fn default() -> anyhow::Result<()> { | ||
common::setup()?; | ||
|
||
let evm_version = era_compiler_common::EVMVersion::Cancun.to_string(); | ||
let args = &[ | ||
"--evm-version", | ||
evm_version.as_str(), | ||
common::TEST_GREETER_CONTRACT_PATH, | ||
]; | ||
|
||
let result = common::execute_zkvyper(args)?; | ||
result.success().stdout(predicate::str::contains("0x")); | ||
|
||
Ok(()) | ||
} | ||
|
||
#[test] | ||
fn llvm_ir_mode() -> anyhow::Result<()> { | ||
common::setup()?; | ||
|
||
let evm_version = era_compiler_common::EVMVersion::Cancun.to_string(); | ||
let args = &[ | ||
"--evm-version", | ||
evm_version.as_str(), | ||
"--llvm-ir", | ||
common::TEST_GREETER_CONTRACT_PATH, | ||
]; | ||
|
||
let result = common::execute_zkvyper(args)?; | ||
result.failure().stderr(predicate::str::contains( | ||
"EVM version is not used in LLVM IR and EraVM assembly modes.", | ||
)); | ||
|
||
Ok(()) | ||
} | ||
|
||
#[test] | ||
fn eravm_assembly_mode() -> anyhow::Result<()> { | ||
common::setup()?; | ||
|
||
let evm_version = era_compiler_common::EVMVersion::Cancun.to_string(); | ||
let args = &[ | ||
"--evm-version", | ||
evm_version.as_str(), | ||
"--eravm-assembly", | ||
common::TEST_GREETER_CONTRACT_PATH, | ||
]; | ||
|
||
let result = common::execute_zkvyper(args)?; | ||
result.failure().stderr(predicate::str::contains( | ||
"EVM version is not used in LLVM IR and EraVM assembly modes.", | ||
)); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use predicates::prelude::*; | ||
|
||
use crate::common; | ||
|
||
#[test] | ||
fn default() -> anyhow::Result<()> { | ||
common::setup()?; | ||
|
||
let args = &["--recursive-process"]; | ||
|
||
let result = common::execute_zkvyper(args)?; | ||
result | ||
.failure() | ||
.stderr(predicate::str::contains("Stdin reading error")); | ||
|
||
Ok(()) | ||
} | ||
|
||
#[test] | ||
fn excess_args() -> anyhow::Result<()> { | ||
common::setup()?; | ||
|
||
let args = &["--recursive-process", common::TEST_GREETER_CONTRACT_PATH]; | ||
|
||
let result = common::execute_zkvyper(args)?; | ||
result.failure().stderr(predicate::str::contains( | ||
"No other options are allowed in recursive mode.", | ||
)); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters