1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
//!doc My first published crate. [wenris@yeah.net]

//!doc simple hello function
pub fn hello() -> String {
    "Hello, Rust!".to_string()
}

#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
        assert_eq!(2 + 2, 4);
    }

    #[test]
    fn test_hello() {
        assert_eq!(super::hello(), "Hello, Rust!");
    }
}