Fix error msg
This commit is contained in:
parent
7b1e9d2f07
commit
f3597d0db6
2 changed files with 10 additions and 10 deletions
|
|
@ -16,7 +16,7 @@ func TestGetTrends(t *testing.T) {
|
||||||
|
|
||||||
for _, trend := range trends {
|
for _, trend := range trends {
|
||||||
if trend == "" {
|
if trend == "" {
|
||||||
t.Error("Expected trend is not empty")
|
t.Error("Expected trend is empty")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ func TestGetTweets(t *testing.T) {
|
||||||
} else {
|
} else {
|
||||||
count++
|
count++
|
||||||
if tweet.ID == "" {
|
if tweet.ID == "" {
|
||||||
t.Error("Expected tweet ID is not empty")
|
t.Error("Expected tweet ID is empty")
|
||||||
} else {
|
} else {
|
||||||
if dupcheck[tweet.ID] {
|
if dupcheck[tweet.ID] {
|
||||||
t.Errorf("Detect duplicated tweet ID: %s", tweet.ID)
|
t.Errorf("Detect duplicated tweet ID: %s", tweet.ID)
|
||||||
|
|
@ -28,32 +28,32 @@ func TestGetTweets(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if tweet.UserID == "" {
|
if tweet.UserID == "" {
|
||||||
t.Error("Expected tweet UserID is not empty")
|
t.Error("Expected tweet UserID is empty")
|
||||||
}
|
}
|
||||||
if tweet.Username == "" {
|
if tweet.Username == "" {
|
||||||
t.Error("Expected tweet Username is not empty")
|
t.Error("Expected tweet Username is empty")
|
||||||
}
|
}
|
||||||
if tweet.PermanentURL == "" {
|
if tweet.PermanentURL == "" {
|
||||||
t.Error("Expected tweet PermanentURL is not empty")
|
t.Error("Expected tweet PermanentURL is empty")
|
||||||
}
|
}
|
||||||
if tweet.Text == "" {
|
if tweet.Text == "" {
|
||||||
t.Error("Expected tweet Text is not empty")
|
t.Error("Expected tweet Text is empty")
|
||||||
}
|
}
|
||||||
if tweet.TimeParsed.IsZero() {
|
if tweet.TimeParsed.IsZero() {
|
||||||
t.Error("Expected tweet TimeParsed is not zero")
|
t.Error("Expected tweet TimeParsed is zero")
|
||||||
}
|
}
|
||||||
if tweet.Timestamp == 0 {
|
if tweet.Timestamp == 0 {
|
||||||
t.Error("Expected tweet Timestamp is greater than zero")
|
t.Error("Expected tweet Timestamp is greater than zero")
|
||||||
}
|
}
|
||||||
for _, video := range tweet.Videos {
|
for _, video := range tweet.Videos {
|
||||||
if video.ID == "" {
|
if video.ID == "" {
|
||||||
t.Error("Expected tweet video ID is not empty")
|
t.Error("Expected tweet video ID is empty")
|
||||||
}
|
}
|
||||||
if video.Preview == "" {
|
if video.Preview == "" {
|
||||||
t.Error("Expected tweet video Preview is not empty")
|
t.Error("Expected tweet video Preview is empty")
|
||||||
}
|
}
|
||||||
if video.URL == "" {
|
if video.URL == "" {
|
||||||
t.Error("Expected tweet video URL is not empty")
|
t.Error("Expected tweet video URL is empty")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue