-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
53 lines (40 loc) · 1.41 KB
/
main_test.go
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
package main
import (
"testing"
)
func TestProcessText1(t *testing.T) {
input := "If I make you BREAKFAST IN BED (low, 3) just say thank you instead of: how (cap) did you get in my house (up, 2) ?"
expected := "If I make you breakfast in bed just say thank you instead of: How did you get in MY HOUSE?"
actual := ProcessText(input)
if actual != expected {
t.Errorf("Result: %s\n", actual)
t.Errorf("Expect: %s\n", expected)
}
}
func TestProcessText2(t *testing.T) {
input := "I have to pack 101 (bin) outfits. Packed 1a (hex) just to be sure"
expected := "I have to pack 5 outfits. Packed 26 just to be sure"
actual := ProcessText(input)
if actual != expected {
t.Errorf("Result: %s\n", actual)
t.Errorf("Expect: %s\n", expected)
}
}
func TestProcessText3(t *testing.T) {
input := "Don not be sad ,because sad backwards is das . And das not good"
expected := "Don not be sad, because sad backwards is das. And das not good"
actual := ProcessText(input)
if actual != expected {
t.Errorf("Result: %s\n", actual)
t.Errorf("Expect: %s\n", expected)
}
}
func TestProcessText4(t *testing.T) {
input := "harold wilson (cap, 2) : ' I am a optimist ,but a optimist who carries a raincoat . '"
expected := "Harold Wilson: 'I am an optimist, but an optimist who carries a raincoat.'"
actual := ProcessText(input)
if actual != expected {
t.Errorf("Result: %s\n", actual)
t.Errorf("Expect: %s\n", expected)
}
}