#[macro_use] extern crate pretty_assertions; // #[macro_use] // extern crate indoc; extern crate quickcheck; extern crate roc_std; #[cfg(test)] mod test_roc_std { use roc_std::RocResult; #[test] fn roc_result_to_rust_result() { let greeting = "Hello, World!"; let roc_result: RocResult = RocResult::ok(greeting.into()); match roc_result.into() { Ok(answer) => { assert_eq!(answer.as_str(), greeting); } Err(()) => { panic!("Received an Err when Ok was expected.") } } } #[test] fn roc_result_is_ok() { let greeting = "Hello, World!"; let roc_result: RocResult = RocResult::ok(greeting.into()); assert!(roc_result.is_ok()); assert!(!roc_result.is_err()); } #[test] fn roc_result_is_err() { let greeting = "Hello, World!"; let roc_result: RocResult<(), String> = RocResult::err(greeting.into()); assert!(!roc_result.is_ok()); assert!(roc_result.is_err()); } }