forked from gotd/botapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuilders_test.go
More file actions
33 lines (27 loc) · 791 Bytes
/
Copy pathbuilders_test.go
File metadata and controls
33 lines (27 loc) · 791 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
package botapi
import (
"bytes"
"testing"
)
func TestBuilders(t *testing.T) {
if kb := Keyboard(Row(Button("a"), ButtonContact("c")), Row(Button("b"))); len(kb.Keyboard) != 2 {
t.Fatalf("keyboard = %#v", kb)
}
if ik := InlineKeyboard([]InlineKeyboardButton{InlineButtonData("x", "d"), InlineButtonURL("u", "https://e")}); len(ik.InlineKeyboard) != 1 {
t.Fatalf("inline keyboard = %#v", ik)
}
for _, f := range []InputFile{
FileID("id"), FileURL("https://e"), FileFromPath("/tmp/x"),
FileFromBytes("n", []byte("d")), FileFromReader("n", bytes.NewReader(nil)),
} {
if f == nil {
t.Fatal("nil input file")
}
}
if e := Emoji("👍"); e == nil {
t.Fatal("nil emoji reaction")
}
if e := CustomEmoji("123"); e == nil {
t.Fatal("nil custom emoji reaction")
}
}