Skip to content

Commit

Permalink
Merge branch 'release/42.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Aug 25, 2020
2 parents 9b8fc2a + 2d00381 commit 0ae08ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion extracts_v6.go
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,7 @@ func extractUserInfosV6(pageHTML []byte, lang string) (UserInfos, error) {
case "gr":
infosRgx = regexp.MustCompile(`([\d\\.]+) \(\\u039a\\u03b1\\u03c4\\u03ac\\u03c4\\u03b1\\u03be\\u03b7 ([\d.]+) \\u03b1\\u03c0\\u03cc ([\d.]+)\)`)
case "tw":
infosRgx = regexp.MustCompile(`([\d\\.]+) \(([\d.]+) \u4eba\u4e2d\u7684\u7b2c ([\d.]+) \u4f4d\)`)
infosRgx = regexp.MustCompile(`([\d\\.]+) \(([\d.]+) \\u4eba\\u4e2d\\u7684\\u7b2c ([\d.]+) \\u4f4d\)`)
case "cz":
infosRgx = regexp.MustCompile(`([\d\\.]+) \(Pozice ([\d.]+) z ([\d.]+)\)`)
case "de":
Expand Down
8 changes: 8 additions & 0 deletions ogame_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,14 @@ func TestExtractUserInfos_hr(t *testing.T) {
assert.Equal(t, int64(252), infos.Total)
}

func TestExtractUserInfos_tw(t *testing.T) {
pageHTMLBytes, _ := ioutil.ReadFile("samples/tw/overview.html")
infos, _ := NewExtractorV6().ExtractUserInfos(pageHTMLBytes, "tw")
assert.Equal(t, int64(0), infos.Points)
assert.Equal(t, int64(212), infos.Rank)
assert.Equal(t, int64(212), infos.Total)
}

func TestExtractUserInfos_no(t *testing.T) {
pageHTMLBytes, _ := ioutil.ReadFile("samples/no/overview.html")
infos, _ := NewExtractorV6().ExtractUserInfos(pageHTMLBytes, "no")
Expand Down

0 comments on commit 0ae08ef

Please sign in to comment.