-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
106 lines (75 loc) · 6.15 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package main
import (
"os/exec"
"testing"
)
func Test001(t *testing.T) {
want := ""
got, _ := exec.Command("go", "run", "main.go", "").Output()
if want != string(got) {
t.Errorf("Expected:\n%s \nGot:\n%s ", want, string(got))
}
}
func Test002(t *testing.T) {
want := "\n"
got, _ := exec.Command("go", "run", "main.go", "\\n").Output()
if want != string(got) {
t.Errorf("Expected:\n%s \nGot:\n%s ", want, string(got))
}
}
func Test003(t *testing.T) {
want := " _ _ _ _ \n| | | | | | | | \n| |__| | ___ | | | | ___ \n| __ | / _ \\ | | | | / _ \\ \n| | | | | __/ | | | | | (_) | \n|_| |_| \\___| |_| |_| \\___/ \n \n \n\n"
got, _ := exec.Command("go", "run", "main.go", "Hello\\n").Output()
if want != string(got) {
t.Errorf("Expected:\n%s \nGot:\n%s ", want, string(got))
}
}
func Test004(t *testing.T) {
want := " _ _ _ \n| | | | | | \n| |__ ___ | | | | ___ \n| _ \\ / _ \\ | | | | / _ \\ \n| | | | | __/ | | | | | (_) | \n|_| |_| \\___| |_| |_| \\___/ \n \n \n"
got, _ := exec.Command("go", "run", "main.go", "hello").Output()
if want != string(got) {
t.Errorf("Expected:\n%s \nGot:\n%s ", want, string(got))
}
}
func Test005(t *testing.T) {
want := " _ _ _ _ ____ \n| | | | | | | | / __ \\ \n| |__| | ___ | | | | | | | | \n| __ | / _ \\ | | | | | | | | \n| | | | | __/ | |____ | | | |__| | \n|_| |_| \\___| |______| |_| \\____/ \n \n \n"
got, _ := exec.Command("go", "run", "main.go", "HeLlO").Output()
if want != string(got) {
t.Errorf("Expected:\n%s \nGot:\n%s ", want, string(got))
}
}
func Test006(t *testing.T) {
want := " _ _ _ _ _______ _ \n| | | | | | | | |__ __| | | \n| |__| | ___ | | | | ___ | | | |__ ___ _ __ ___ \n| __ | / _ \\ | | | | / _ \\ | | | _ \\ / _ \\ | '__| / _ \\ \n| | | | | __/ | | | | | (_) | | | | | | | | __/ | | | __/ \n|_| |_| \\___| |_| |_| \\___/ |_| |_| |_| \\___| |_| \\___| \n \n \n"
got, _ := exec.Command("go", "run", "main.go", "Hello There").Output()
if want != string(got) {
t.Errorf("Expected:\n%s \nGot:\n%s ", want, string(got))
}
}
func Test007(t *testing.T) {
want := " _ _ _ _ _______ _ \n _ | | | | | | | | ____ |__ __| | | \n/ | | |__| | ___ | | | | ___ |___ \\ | | | |__ ___ _ __ ___ \n| | | __ | / _ \\ | | | | / _ \\ __) | | | | _ \\ / _ \\ | '__| / _ \\ \n| | | | | | | __/ | | | | | (_) | / __/ | | | | | | | __/ | | | __/ \n|_| |_| |_| \\___| |_| |_| \\___/ |_____| |_| |_| |_| \\___| |_| \\___| \n \n \n"
got, _ := exec.Command("go", "run", "main.go", "1Hello 2There").Output()
if want != string(got) {
t.Errorf("Expected:\n%s \nGot:\n%s ", want, string(got))
}
}
func Test008(t *testing.T) {
want := " __ _ _ _ _ _______ _ __ \n / / | | | | | | | | |__ __| | | \\ \\ \n | | | |__| | ___ | | | | ___ | | | |__ ___ _ __ ___ | | \n/ / | __ | / _ \\ | | | | / _ \\ | | | _ \\ / _ \\ | '__| / _ \\ \\ \\ \n\\ \\ | | | | | __/ | | | | | (_) | | | | | | | | __/ | | | __/ / / \n | | |_| |_| \\___| |_| |_| \\___/ |_| |_| |_| \\___| |_| \\___| | | \n \\_\\ /_/ \n \n"
got, _ := exec.Command("go", "run", "main.go", "{Hello There}").Output()
if want != string(got) {
t.Errorf("Expected:\n%s \nGot:\n%s ", want, string(got))
}
}
func Test009(t *testing.T) {
want := " _ _ _ _ \n| | | | | | | | \n| |__| | ___ | | | | ___ \n| __ | / _ \\ | | | | / _ \\ \n| | | | | __/ | | | | | (_) | \n|_| |_| \\___| |_| |_| \\___/ \n \n \n _______ _ \n|__ __| | | \n | | | |__ ___ _ __ ___ \n | | | _ \\ / _ \\ | '__| / _ \\ \n | | | | | | | __/ | | | __/ \n |_| |_| |_| \\___| |_| \\___| \n \n \n"
got, _ := exec.Command("go", "run", "main.go", "Hello\\nThere").Output()
if want != string(got) {
t.Errorf("Expected:\n%s \nGot:\n%s ", want, string(got))
}
}
func Test010(t *testing.T) {
want := " _ _ _ _ \n| | | | | | | | \n| |__| | ___ | | | | ___ \n| __ | / _ \\ | | | | / _ \\ \n| | | | | __/ | | | | | (_) | \n|_| |_| \\___| |_| |_| \\___/ \n \n \n\n _______ _ \n|__ __| | | \n | | | |__ ___ _ __ ___ \n | | | _ \\ / _ \\ | '__| / _ \\ \n | | | | | | | __/ | | | __/ \n |_| |_| |_| \\___| |_| \\___| \n \n \n"
got, _ := exec.Command("go", "run", "main.go", "Hello\\n\\nThere").Output()
if want != string(got) {
t.Errorf("Expected:\n%s \nGot:\n%s ", want, string(got))
}
}