@@ -38,7 +38,8 @@ func testForgetful(ctx context.Context, br Interface) func(t *testing.T) {
38
38
Time : time .Unix (0 , 0 ),
39
39
}
40
40
text := "bocchi ryou nijika kita"
41
- if err := brain .Learn (ctx , br , & msg , brain .Tokens (nil , text )); err != nil {
41
+ toks := brain .Tokens (nil , text )
42
+ if err := brain .Learn (ctx , br , & msg , toks ); err != nil {
42
43
t .Errorf ("failed to learn: %v" , err )
43
44
}
44
45
s , err := brain .Speak (ctx , br , tag , "" )
@@ -48,14 +49,14 @@ func testForgetful(ctx context.Context, br Interface) func(t *testing.T) {
48
49
if s != text {
49
50
t .Errorf ("surprise thought: %q" , s )
50
51
}
51
- if err := brain .Forget (ctx , br , tag , brain . Tokens ( nil , text ) ); err != nil {
52
+ if err := brain .Forget (ctx , br , tag , toks ); err != nil {
52
53
t .Errorf ("failed to forget: %v" , err )
53
54
}
54
55
// We don't really care about an error here, since the brain is empty.
55
56
// All we care about is no thoughts.
56
57
s , _ = brain .Speak (ctx , br , tag , "" )
57
58
if s != "" {
58
- t .Errorf ("remembered that which must be forgotten: %v " , err )
59
+ t .Errorf ("remembered that which must be forgotten: %q " , s )
59
60
}
60
61
}
61
62
}
0 commit comments