mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-16 06:11:08 +00:00
Implement Rust CLI tests (#372)
# Description Closes #365 Ports all `resolc` CLI tests to Rust and removes the CLI TypeScript tests.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
//! The tests for running resolc when expecting usage output.
|
||||
|
||||
#![cfg(test)]
|
||||
|
||||
use crate::tests::cli::utils;
|
||||
|
||||
#[test]
|
||||
#[ignore = "Fix: 'resolc --help' should exit with success exit code"]
|
||||
fn shows_usage_with_help() {
|
||||
let arguments = &["--help"];
|
||||
let resolc_result = utils::execute_resolc(arguments);
|
||||
utils::assert_command_success(&resolc_result, "Providing the `--help` option");
|
||||
|
||||
assert!(
|
||||
resolc_result.stdout.contains("Usage: resolc"),
|
||||
"Expected the output to contain usage information."
|
||||
);
|
||||
|
||||
let solc_result = utils::execute_solc(arguments);
|
||||
utils::assert_equal_exit_codes(&solc_result, &resolc_result);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fails_without_options() {
|
||||
let resolc_result = utils::execute_resolc(&[]);
|
||||
utils::assert_command_failure(&resolc_result, "Omitting options");
|
||||
|
||||
assert!(
|
||||
resolc_result.stderr.contains("Usage: resolc"),
|
||||
"Expected the output to contain usage information."
|
||||
);
|
||||
|
||||
let solc_result = utils::execute_solc(&[]);
|
||||
utils::assert_equal_exit_codes(&solc_result, &resolc_result);
|
||||
}
|
||||
Reference in New Issue
Block a user