Skip to content

Commit 35a2a1b

Browse files
authored
switching to assert.Empty from assert.Equal empty (#181)
1 parent 5457098 commit 35a2a1b

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

src/TibiaCharactersCharacterV3_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func TestNumber3(t *testing.T) {
110110
assert.Equal("Zunera", characterJson.Characters.Character.FormerWorlds[1])
111111
assert.Equal("Bubble", characterJson.Characters.Character.MarriedTo)
112112
assert.Equal("2022-03-08T00:09:13Z", characterJson.Characters.Character.DeletionDate)
113-
assert.Equal("", characterJson.Characters.Character.LastLogin)
113+
assert.Empty(characterJson.Characters.Character.LastLogin)
114114
assert.Equal("Free Account", characterJson.Characters.Character.AccountStatus)
115115
assert.Equal("Fansite Admin", characterJson.Characters.AccountInformation.Position)
116116
assert.Empty(characterJson.Characters.AccountInformation.LoyaltyTitle)

src/TibiaFansitesV3_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestFansites(t *testing.T) {
4444
assert.Equal("Discord server.", tibiaDataFansite.Specials[1])
4545
assert.Equal("GitHub participant.", tibiaDataFansite.Specials[2])
4646
assert.False(tibiaDataFansite.FansiteItem)
47-
assert.Equal("", tibiaDataFansite.FansiteItemURL)
47+
assert.Empty(tibiaDataFansite.FansiteItemURL)
4848

4949
tibiaGalleryFansite := fansitesJson.Fansites.SupportedFansites[8]
5050
assert.Equal("TibiaGallery.com", tibiaGalleryFansite.Name)

src/TibiaHighscoresV3_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestHighscoresAll(t *testing.T) {
1717
highscoresJson := TibiaHighscoresV3Impl("", experience, "all", 1, string(data))
1818
assert := assert.New(t)
1919

20-
assert.Equal("", highscoresJson.Highscores.World)
20+
assert.Empty(highscoresJson.Highscores.World)
2121
assert.Equal("experience", highscoresJson.Highscores.Category)
2222
assert.Equal("all", highscoresJson.Highscores.Vocation)
2323
assert.Equal(12, highscoresJson.Highscores.HighscoreAge)
@@ -35,7 +35,7 @@ func TestHighscoresAll(t *testing.T) {
3535
assert.Equal("Bona", firstHighscore.World)
3636
assert.Equal(2197, firstHighscore.Level)
3737
assert.Equal(176271164607, firstHighscore.Value)
38-
assert.Equal("", firstHighscore.Title)
38+
assert.Empty(firstHighscore.Title)
3939

4040
lastHighscore := highscoresJson.Highscores.HighscoreList[49]
4141
assert.Equal(50, lastHighscore.Rank)
@@ -44,7 +44,7 @@ func TestHighscoresAll(t *testing.T) {
4444
assert.Equal("Refugia", lastHighscore.World)
4545
assert.Equal(1701, lastHighscore.Level)
4646
assert.Equal(81816135617, lastHighscore.Value)
47-
assert.Equal("", lastHighscore.Title)
47+
assert.Empty(lastHighscore.Title)
4848
}
4949

5050
func TestHighscoresLoyalty(t *testing.T) {

src/TibiaHousesHouseV3_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestCormaya10(t *testing.T) {
1919

2020
assert.Equal(54025, houseJson.House.Houseid)
2121
assert.Equal("Premia", houseJson.House.World)
22-
assert.Equal("", houseJson.House.Town) //depends on TibiaDataHousesMapResolver
22+
assert.Empty(houseJson.House.Town) //depends on TibiaDataHousesMapResolver
2323
assert.Equal("Cormaya 10", houseJson.House.Name)
2424
assert.Equal("house", houseJson.House.Type)
2525
assert.Equal(3, houseJson.House.Beds)
@@ -59,7 +59,7 @@ func TestCormaya11(t *testing.T) {
5959

6060
assert.Equal(54026, houseJson.House.Houseid)
6161
assert.Equal("Premia", houseJson.House.World)
62-
assert.Equal("", houseJson.House.Town) //depends on TibiaDataHousesMapResolver
62+
assert.Empty(houseJson.House.Town) //depends on TibiaDataHousesMapResolver
6363
assert.Equal("Cormaya 11", houseJson.House.Name)
6464
assert.Equal("house", houseJson.House.Type)
6565
assert.Equal(2, houseJson.House.Beds)
@@ -96,7 +96,7 @@ func TestCormaya9c(t *testing.T) {
9696

9797
assert.Equal(54023, houseJson.House.Houseid)
9898
assert.Equal("Premia", houseJson.House.World)
99-
assert.Equal("", houseJson.House.Town) //depends on TibiaDataHousesMapResolver
99+
assert.Empty(houseJson.House.Town) //depends on TibiaDataHousesMapResolver
100100
assert.Equal("Cormaya 9c", houseJson.House.Name)
101101
assert.Equal("house", houseJson.House.Type)
102102
assert.Equal(2, houseJson.House.Beds)
@@ -133,7 +133,7 @@ func TestBeachHomeApartmentsFlat14(t *testing.T) {
133133

134134
assert.Equal(10214, houseJson.House.Houseid)
135135
assert.Equal("Premia", houseJson.House.World)
136-
assert.Equal("", houseJson.House.Town) //depends on TibiaDataHousesMapResolver
136+
assert.Empty(houseJson.House.Town) //depends on TibiaDataHousesMapResolver
137137
assert.Equal("Beach Home Apartments, Flat 14", houseJson.House.Name)
138138
assert.Equal("house", houseJson.House.Type)
139139
assert.Equal(1, houseJson.House.Beds)
@@ -170,7 +170,7 @@ func TestBeachHomeApartmentsFlat15(t *testing.T) {
170170

171171
assert.Equal(10215, houseJson.House.Houseid)
172172
assert.Equal("Premia", houseJson.House.World)
173-
assert.Equal("", houseJson.House.Town) //depends on TibiaDataHousesMapResolver
173+
assert.Empty(houseJson.House.Town) //depends on TibiaDataHousesMapResolver
174174
assert.Equal("Beach Home Apartments, Flat 15", houseJson.House.Name)
175175
assert.Equal("house", houseJson.House.Type)
176176
assert.Equal(1, houseJson.House.Beds)

src/TibiaNewsV3_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestNewsById(t *testing.T) {
1919

2020
assert.Equal(6529, newsArticleJson.News.ID)
2121
assert.Equal("2022-01-12", newsArticleJson.News.Date)
22-
assert.Equal("", newsArticleJson.News.Title)
22+
assert.Empty(newsArticleJson.News.Title)
2323
assert.Equal("development", newsArticleJson.News.Category)
2424
assert.Equal("ticker", newsArticleJson.News.Type)
2525
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=6529", newsArticleJson.News.TibiaURL)
@@ -39,7 +39,7 @@ func TestNews6512(t *testing.T) {
3939

4040
assert.Equal(6512, newsArticleJson.News.ID)
4141
assert.Equal("2022-01-04", newsArticleJson.News.Date)
42-
assert.Equal("", newsArticleJson.News.Title)
42+
assert.Empty(newsArticleJson.News.Title)
4343
assert.Equal("community", newsArticleJson.News.Category)
4444
assert.Equal("ticker", newsArticleJson.News.Type)
4545
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=6512", newsArticleJson.News.TibiaURL)
@@ -61,7 +61,7 @@ func TestNews6481(t *testing.T) {
6161
assert.Equal("2021-12-22", newsArticleJson.News.Date)
6262
assert.Equal("New Mounts", newsArticleJson.News.Title)
6363
assert.Equal("development", newsArticleJson.News.Category)
64-
assert.Equal("", newsArticleJson.News.Type)
64+
assert.Empty(newsArticleJson.News.Type)
6565
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=6481", newsArticleJson.News.TibiaURL)
6666
assert.Equal("New mounts have been added to the Store today!\nThe origins of the Emerald Raven, Mystic Raven, and Radiant Raven are shrouded in darkness, as no written record nor tale told by even the most knowing storytellers mentions but a trace of them. Superstition surrounds them, as some see these gigantic birds as an echo of a long forgotten past, while others believe them to herald hitherto unknown events. What is clear is that they are highly intelligent beings which make great companions if they deem somebody worthy.\n\nClick on image to enlarge.\n\nOnce bought, your character can use the mount ingame anytime, no matter if you are a free account or a Premium account.\nGet yourself a corvid companion!Your Community Managers ", newsArticleJson.News.Content)
6767
assert.Equal("<p>New mounts have been added to the Store today!</p>\n<p>The origins of the <strong>Emerald Raven</strong>, <strong>Mystic Raven</strong>, and <strong>Radiant Raven</strong> are shrouded in darkness, as no written record nor tale told by even the most knowing storytellers mentions but a trace of them. Superstition surrounds them, as some see these gigantic birds as an echo of a long forgotten past, while others believe them to herald hitherto unknown events. What is clear is that they are highly intelligent beings which make great companions if they deem somebody worthy.</p>\n<figure><center><img style=\"cursor: pointer;\" src=\"https://static.tibia.com/images/news/emeraldraven_small.jpg\" onclick=\"ImageInNewWindow(&#39;https://static.tibia.com/images/news/emeraldraven.jpg&#39;)\"/></center>\n<figcaption><center><em>Click on image to enlarge.</em></center></figcaption>\n</figure>\n<p>Once bought, your character can use the mount ingame anytime, no matter if you are a free account or a Premium account.</p>\n<p>Get yourself a corvid companion!<br/>Your Community Managers</p> ", newsArticleJson.News.ContentHTML)

src/TibiaSpellsSpellV3_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestFindPerson(t *testing.T) {
1717
findPersonJson := TibiaSpellsSpellV3Impl("Find Person", string(data))
1818
assert := assert.New(t)
1919

20-
assert.Equal("", findPersonJson.Spells.Spell.Description)
20+
assert.Empty(findPersonJson.Spells.Spell.Description)
2121
assert.Equal("Find Person", findPersonJson.Spells.Spell.Name)
2222
assert.Equal("find person", findPersonJson.Spells.Spell.Spell)
2323
assert.True(findPersonJson.Spells.Spell.HasSpellInformation)
@@ -55,7 +55,7 @@ func TestHeavyMagicMissileRune(t *testing.T) {
5555
hmmJson := TibiaSpellsSpellV3Impl("Heavy Magic Missile Rune", string(data))
5656
assert := assert.New(t)
5757

58-
assert.Equal("", hmmJson.Spells.Spell.Description)
58+
assert.Empty(hmmJson.Spells.Spell.Description)
5959
assert.Equal("Heavy Magic Missile Rune", hmmJson.Spells.Spell.Name)
6060
assert.Equal("heavy magic missile rune", hmmJson.Spells.Spell.Spell)
6161
assert.True(hmmJson.Spells.Spell.HasSpellInformation)
@@ -104,7 +104,7 @@ func TestAnnihilation(t *testing.T) {
104104
annihilationJson := TibiaSpellsSpellV3Impl("Annihilation", string(data))
105105
assert := assert.New(t)
106106

107-
assert.Equal("", annihilationJson.Spells.Spell.Description)
107+
assert.Empty(annihilationJson.Spells.Spell.Description)
108108
assert.Equal("Annihilation", annihilationJson.Spells.Spell.Name)
109109
assert.Equal("annihilation", annihilationJson.Spells.Spell.Spell)
110110
assert.True(annihilationJson.Spells.Spell.HasSpellInformation)
@@ -137,7 +137,7 @@ func TestBruiseBane(t *testing.T) {
137137
bruisebaneJson := TibiaSpellsSpellV3Impl("Bruise Bane", string(data))
138138
assert := assert.New(t)
139139

140-
assert.Equal("", bruisebaneJson.Spells.Spell.Description)
140+
assert.Empty(bruisebaneJson.Spells.Spell.Description)
141141
assert.Equal("Bruise Bane", bruisebaneJson.Spells.Spell.Name)
142142
assert.Equal("bruise bane", bruisebaneJson.Spells.Spell.Spell)
143143
assert.True(bruisebaneJson.Spells.Spell.HasSpellInformation)
@@ -170,7 +170,7 @@ func TestCurePoisonRune(t *testing.T) {
170170
curepoisonruneJson := TibiaSpellsSpellV3Impl("Cure Poison Rune", string(data))
171171
assert := assert.New(t)
172172

173-
assert.Equal("", curepoisonruneJson.Spells.Spell.Description)
173+
assert.Empty(curepoisonruneJson.Spells.Spell.Description)
174174
assert.Equal("Cure Poison Rune", curepoisonruneJson.Spells.Spell.Name)
175175
assert.Equal("cure poison rune", curepoisonruneJson.Spells.Spell.Spell)
176176
assert.True(curepoisonruneJson.Spells.Spell.HasSpellInformation)
@@ -199,7 +199,7 @@ func TestConvinceCreatureRune(t *testing.T) {
199199
convincecreatureruneJson := TibiaSpellsSpellV3Impl("Convince Creature Rune", string(data))
200200
assert := assert.New(t)
201201

202-
assert.Equal("", convincecreatureruneJson.Spells.Spell.Description)
202+
assert.Empty(convincecreatureruneJson.Spells.Spell.Description)
203203
assert.Equal("Convince Creature Rune", convincecreatureruneJson.Spells.Spell.Name)
204204
assert.Equal("convince creature rune", convincecreatureruneJson.Spells.Spell.Spell)
205205
assert.True(convincecreatureruneJson.Spells.Spell.HasSpellInformation)

0 commit comments

Comments
 (0)