Skip to content

Instantly share code, notes, and snippets.

@steveklabnik
Created January 4, 2015 03:28
Embed
What would you like to do?
pub fn foo() -> int { 5 }
$ rustc code.rs
$ rustc --test tests.rs --extern code=libcode.rlib
$ ./tests
extern crate code;
#[test]
fn test_foo() {
assert_eq!(5, code::foo());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment