File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
filesystem-directory/loop
filesystem-listen-directory/loop Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import (
13
13
)
14
14
15
15
func TestController (t * testing.T ) {
16
+ markdownDoneChan := make (chan bool )
17
+
16
18
type template struct {
17
19
Name string
18
20
Size int
@@ -37,6 +39,7 @@ func TestController(t *testing.T) {
37
39
if got := w .Markdown ; ! cmp .Equal (got , exp ) {
38
40
t .Errorf ("unexpected markdown:\n %s\n " , cmp .Diff (got , exp ))
39
41
}
42
+ markdownDoneChan <- true
40
43
return nil
41
44
},
42
45
},
@@ -49,6 +52,7 @@ func TestController(t *testing.T) {
49
52
if err := c .LoopStart (sidekick ); err != nil {
50
53
t .Fatal (err )
51
54
}
55
+ <- markdownDoneChan
52
56
if err := c .LoopStop (); err != nil {
53
57
t .Fatal (err )
54
58
}
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ func (c *Loop) emitExampleWhisper(fe ldk.FileEvent) error {
128
128
}
129
129
}()
130
130
131
- // c.logger.Info("Sent message", "markdown", markdownBytes.String())
131
+ c .logger .Info ("Sent message" , "markdown" , markdownBytes .String ())
132
132
133
133
return nil
134
134
}
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import (
13
13
)
14
14
15
15
func TestController (t * testing.T ) {
16
+ markdownDoneChan := make (chan bool )
17
+
16
18
sidekick := & ldktest.Sidekick {
17
19
FilesystemService : & ldktest.FilesystemService {
18
20
ListenDirf : func (ctx context.Context , dir string , cb ldk.ListenDirHandler ) error {
@@ -27,6 +29,7 @@ func TestController(t *testing.T) {
27
29
if got := w .Markdown ; ! cmp .Equal (got , exp ) {
28
30
t .Errorf ("unexpected markdown:\n %s\n " , cmp .Diff (got , exp ))
29
31
}
32
+ markdownDoneChan <- true
30
33
return nil
31
34
},
32
35
},
@@ -39,6 +42,7 @@ func TestController(t *testing.T) {
39
42
if err := c .LoopStart (sidekick ); err != nil {
40
43
t .Fatal (err )
41
44
}
45
+ <- markdownDoneChan
42
46
if err := c .LoopStop (); err != nil {
43
47
t .Fatal (err )
44
48
}
You can’t perform that action at this time.
0 commit comments