-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhacker.rs
64 lines (51 loc) · 1.25 KB
/
hacker.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
use crate::data::hacker;
use crate::generator;
use crate::misc;
pub fn phrase() -> String {
let phrase = misc::random_data(hacker::PHRASE).to_string();
generator::generate(phrase)
}
pub fn abbreviation() -> String {
misc::random_data(hacker::ABBREVIATION).to_string()
}
pub fn adjective() -> String {
misc::random_data(hacker::ADJECTIVE).to_string()
}
pub fn noun() -> String {
misc::random_data(hacker::NOUN).to_string()
}
pub fn verb() -> String {
misc::random_data(hacker::VERB).to_string()
}
pub fn ingverb() -> String {
misc::random_data(hacker::INGVERB).to_string()
}
#[cfg(test)]
mod tests {
use crate::hacker;
use crate::testify::exec_mes;
#[test]
fn phrase() {
exec_mes("hacker::phrase", || hacker::phrase());
}
#[test]
fn abbreviation() {
exec_mes("hacker::abbreviation", || hacker::abbreviation());
}
#[test]
fn adjective() {
exec_mes("hacker::adjective", || hacker::adjective());
}
#[test]
fn noun() {
exec_mes("hacker::noun", || hacker::noun());
}
#[test]
fn verb() {
exec_mes("hacker::verb", || hacker::verb());
}
#[test]
fn ingverb() {
exec_mes("hacker::ingverb", || hacker::ingverb());
}
}