Don't parse arguments during cargo test (#37)

Otherwise, running the tests with special arguments (e.g. `cargo test --
--test-threads 1`) will break.
This commit is contained in:
Maximilian Bosch 2020-08-29 17:15:21 +02:00 committed by GitHub
parent ee833337df
commit ff3ac137ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,10 +36,21 @@ struct Configuration {
input: String,
}
#[cfg(not(test))]
lazy_static! {
static ref CONFIGURATION: Configuration = parse_arguments();
}
#[cfg(test)]
lazy_static! {
static ref CONFIGURATION: Configuration = Configuration {
radian_mode: false,
fix: 10,
base: 10,
input: "".to_string(),
};
}
fn main() {
if !CONFIGURATION.input.is_empty() {
// command mode //