diff options
author | Maximilian Bosch <[email protected]> | 2020-08-29 16:15:21 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-29 16:15:21 +0100 |
commit | ff3ac137eda1f20bbdc339bd758301d3082f6636 (patch) | |
tree | 405d3b19b9d4c6e7c1234e68dbceebe8c3216cf5 /src | |
parent | ee833337dff33cea08397f45128b7a69f66d63ae (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.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 11 |
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))] | ||
39 | lazy_static! { | 40 | lazy_static! { |
40 | static ref CONFIGURATION: Configuration = parse_arguments(); | 41 | static ref CONFIGURATION: Configuration = parse_arguments(); |
41 | } | 42 | } |
42 | 43 | ||
44 | #[cfg(test)] | ||
45 | lazy_static! { | ||
46 | static ref CONFIGURATION: Configuration = Configuration { | ||
47 | radian_mode: false, | ||
48 | fix: 10, | ||
49 | base: 10, | ||
50 | input: "".to_string(), | ||
51 | }; | ||
52 | } | ||
53 | |||
43 | fn main() { | 54 | fn main() { |
44 | if !CONFIGURATION.input.is_empty() { | 55 | if !CONFIGURATION.input.is_empty() { |
45 | // command mode // | 56 | // command mode // |