aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Bosch <[email protected]>2020-08-29 16:15:21 +0100
committerGitHub <[email protected]>2020-08-29 16:15:21 +0100
commitff3ac137eda1f20bbdc339bd758301d3082f6636 (patch)
tree405d3b19b9d4c6e7c1234e68dbceebe8c3216cf5
parentee833337dff33cea08397f45128b7a69f66d63ae (diff)
Don't parse arguments during `cargo test` (#37)
Otherwise, running the tests with special arguments (e.g. `cargo test -- --test-threads 1`) will break.
-rw-r--r--src/main.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index d241b58..2a2cf9d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -36,10 +36,21 @@ struct Configuration {
36 input: String, 36 input: String,
37} 37}
38 38
39#[cfg(not(test))]
39lazy_static! { 40lazy_static! {
40 static ref CONFIGURATION: Configuration = parse_arguments(); 41 static ref CONFIGURATION: Configuration = parse_arguments();
41} 42}
42 43
44#[cfg(test)]
45lazy_static! {
46 static ref CONFIGURATION: Configuration = Configuration {
47 radian_mode: false,
48 fix: 10,
49 base: 10,
50 input: "".to_string(),
51 };
52}
53
43fn main() { 54fn main() {
44 if !CONFIGURATION.input.is_empty() { 55 if !CONFIGURATION.input.is_empty() {
45 // command mode // 56 // command mode //