diff options
author | tummychow <tummychow@users.noreply.github.com> | 2018-02-15 11:02:32 -0800 |
---|---|---|
committer | tummychow <tummychow@users.noreply.github.com> | 2018-02-15 11:02:32 -0800 |
commit | 829d3d411419a34c6fae4a62327efd4aa6799e19 (patch) | |
tree | b35c0fab5e0f0693946960fa27871d26d66ec1b0 | |
parent | dc5afaf6f1f109d062ee4da121089e107f473243 (diff) |
add lib and test
-rw-r--r-- | src/lib.rs | 15 | ||||
-rw-r--r-- | src/main.rs | 13 |
2 files changed, 27 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..2a3edc1 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,15 @@ +use std::error::Error; + +pub fn run() -> Result<(), Box<Error>> { + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_run() { + assert!(run().is_ok()); + } +} diff --git a/src/main.rs b/src/main.rs index e7a11a9..682a773 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,14 @@ +extern crate git_absorb; + +use std::env; +use std::process; + fn main() { - println!("Hello, world!"); + if let Err(e) = git_absorb::run() { + eprintln!("error: {:?}", e); + process::exit(1); + } + + let args: Vec<String> = env::args().collect(); + println!("{:?}", args); } |