-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapps_test.go
More file actions
44 lines (36 loc) · 833 Bytes
/
apps_test.go
File metadata and controls
44 lines (36 loc) · 833 Bytes
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
package cmd
import "testing"
func TestPrintLogLinesBadLine(t *testing.T) {
t.Parallel()
// Regression test for https://github.com/deis/deis/issues/4420
logs := `\nDone preparing production files\n\n\u001b[4mRunning \"concat:plugins\" (concat) task\u001b[24m\n`
if err := printLogs(logs); err != nil {
t.Fatal(err)
}
logs = `\n\n\n`
if err := printLogs(logs); err != nil {
t.Fatal(err)
}
}
type expandURLCases struct {
Input string
Expected string
}
func TestExpandUrl(t *testing.T) {
checks := []expandURLCases{
{
Input: "test.com",
Expected: "test.com",
},
{
Input: "test",
Expected: "test.foo.com",
},
}
for _, check := range checks {
out := expandURL("deis.foo.com", check.Input)
if out != check.Expected {
t.Errorf("Expected %s, Got %s", check.Expected, out)
}
}
}