Skip to content

Commit 001a467

Browse files
committed
chore: add world/antica testcase for umlaut name
1 parent ededcee commit 001a467

2 files changed

Lines changed: 826 additions & 0 deletions

File tree

src/TibiaWorldsWorld_test.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,35 @@ import (
88
"github.com/tibiadata/tibiadata-api-go/src/static"
99
)
1010

11+
func TestWorldAntica(t *testing.T) {
12+
file, err := static.TestFiles.Open("testdata/worlds/world/Antica.html")
13+
if err != nil {
14+
t.Fatalf("file opening error: %s", err)
15+
}
16+
defer file.Close()
17+
18+
data, err := io.ReadAll(file)
19+
if err != nil {
20+
t.Fatalf("File reading error: %s", err)
21+
}
22+
23+
worldJson, err := TibiaWorldsWorldImpl("Antica", string(data), "https://www.tibia.com/community/?subtopic=worlds&world=Antica")
24+
if err != nil {
25+
t.Fatal(err)
26+
}
27+
28+
assert := assert.New(t)
29+
world := worldJson.World
30+
information := worldJson.Information
31+
32+
assert.Equal("https://www.tibia.com/community/?subtopic=worlds&world=Antica", information.TibiaURLs[0])
33+
34+
umlautPlayer := world.OnlinePlayers[171]
35+
assert.Equal("Nöber", umlautPlayer.Name)
36+
assert.Equal(455, umlautPlayer.Level)
37+
assert.Equal("Elder Druid", umlautPlayer.Vocation)
38+
}
39+
1140
func TestWorldEndebra(t *testing.T) {
1241
file, err := static.TestFiles.Open("testdata/worlds/world/Endebra.html")
1342
if err != nil {

0 commit comments

Comments
 (0)