1
exercism fetch rust acronym

tests/acronym.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
extern crate acronym;

#[test]
fn basic() {
  assert_eq!(acronym::abbreviate("Portable Network Graphics"), "PNG");
}

#[test]
#[ignore]
fn lowercase_words() {
  assert_eq!(acronym::abbreviate("Ruby on Rails"), "ROR");
}

#[test]
#[ignore]
fn camelcase() {
    assert_eq!(acronym::abbreviate("HyperText Markup Language"), "HTML");
}

#[test]
#[ignore]
fn punctuation() {
    assert_eq!(acronym::abbreviate("First In, First Out"), "FIFO");
}

#[test]
#[ignore]
fn all_caps_words() {
    assert_eq!(acronym::abbreviate("PHP: Hypertext Preprocessor"), "PHP");
}

#[test]
#[ignore]
fn non_acronym_all_caps_word() {
    assert_eq!(acronym::abbreviate("GNU Image Manipulation Program"), "GIMP");
}

#[test]
#[ignore]
fn hyphenated() {
    assert_eq!(acronym::abbreviate("Complementary metal-oxide semiconductor"),
               "CMOS");
}