-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction_test.go
More file actions
35 lines (29 loc) · 815 Bytes
/
Copy pathaction_test.go
File metadata and controls
35 lines (29 loc) · 815 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
package main
import "testing"
func TestExtractRawActions(t *testing.T) {
actions, err := extractRawActions(re)
if err != nil {
t.Fatal(err)
}
if v, ex := len(actions), 3; ex != v {
t.Fatalf("expected to get %d actions, was %d", ex, v)
}
if v, ex := actions[0].Action, "p"; ex != v {
t.Errorf("expected first action to be %q, was %q", ex, v)
}
if v, ex := actions[0].ID, "1234"; ex != v {
t.Errorf("expected first id to be %q, was %q", ex, v)
}
if v, ex := actions[0].Message, "first message"; ex != v {
t.Errorf("expected message to be %q, was %q", ex, v)
}
if v, ex := actions[1].Description, "description\n\ntext 1"; ex != v {
t.Errorf("expected description of to be %q, was %q", ex, v)
}
}
const re = `p 1234 first message
p 1235 second task
description
text 1
p 1236 third task
`