aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--telegabber_test.go19
-rw-r--r--telegram/client_test.go19
-rw-r--r--telegram/utils_test.go16
3 files changed, 28 insertions, 26 deletions
diff --git a/telegabber_test.go b/telegabber_test.go
new file mode 100644
index 0000000..459f333
--- /dev/null
+++ b/telegabber_test.go
@@ -0,0 +1,19 @@
+package main
+
+import (
+ "testing"
+)
+
+func TestTdlibLogInfo(t *testing.T) {
+ tdlibConstant := stringToTdlibLogConstant(":info")
+ if tdlibConstant != 3 {
+ t.Errorf("Wrong TDlib constant for info")
+ }
+}
+
+func TestTdlibLogInvalid(t *testing.T) {
+ tdlibConstant := stringToTdlibLogConstant("ziz")
+ if tdlibConstant != 0 {
+ t.Errorf("Unknown strings should return fatal loglevel")
+ }
+}
diff --git a/telegram/client_test.go b/telegram/client_test.go
deleted file mode 100644
index 4c757e1..0000000
--- a/telegram/client_test.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package telegram
-
-import (
- "testing"
-)
-
-func TestLogInfo(t *testing.T) {
- tdlibConstant := stringToLogConstant(":info")
- if tdlibConstant != 3 {
- t.Errorf("Wrong TDlib constant for info")
- }
-}
-
-func TestLogInvalid(t *testing.T) {
- tdlibConstant := stringToLogConstant("ziz")
- if tdlibConstant != 0 {
- t.Errorf("Unknown strings should return fatal loglevel")
- }
-}
diff --git a/telegram/utils_test.go b/telegram/utils_test.go
index e54ddb5..47e30dc 100644
--- a/telegram/utils_test.go
+++ b/telegram/utils_test.go
@@ -431,7 +431,7 @@ func TestMessageToPrefix1(t *testing.T) {
Id: 42,
IsOutgoing: true,
ForwardInfo: &client.MessageForwardInfo{
- Origin: &client.MessageForwardOriginHiddenUser{
+ Origin: &client.MessageOriginHiddenUser{
SenderName: "ziz",
},
},
@@ -452,7 +452,7 @@ func TestMessageToPrefix2(t *testing.T) {
message := client.Message{
Id: 56,
ForwardInfo: &client.MessageForwardInfo{
- Origin: &client.MessageForwardOriginChannel{
+ Origin: &client.MessageOriginChannel{
AuthorSignature: "zaz",
},
},
@@ -473,7 +473,7 @@ func TestMessageToPrefix3(t *testing.T) {
message := client.Message{
Id: 56,
ForwardInfo: &client.MessageForwardInfo{
- Origin: &client.MessageForwardOriginChannel{
+ Origin: &client.MessageOriginChannel{
AuthorSignature: "zuz",
},
},
@@ -511,7 +511,7 @@ func TestMessageToPrefix5(t *testing.T) {
message := client.Message{
Id: 560,
ForwardInfo: &client.MessageForwardInfo{
- Origin: &client.MessageForwardOriginChat{
+ Origin: &client.MessageOriginChat{
AuthorSignature: "zyz",
},
},
@@ -530,9 +530,11 @@ func TestMessageToPrefix5(t *testing.T) {
func TestMessageToPrefix6(t *testing.T) {
message := client.Message{
- Id: 23,
- IsOutgoing: true,
- ReplyToMessageId: 42,
+ Id: 23,
+ IsOutgoing: true,
+ ReplyTo: &client.MessageReplyToMessage{
+ MessageId: 42,
+ },
}
reply := client.Message{
Id: 42,