123456789101112131415161718192021222324252627282930313233343536 |
- package main
-
- import "testing"
-
- func testParseScore(t *testing.T) {
- s := parseScore("[[Image:1.png]][[Image:1.png]][[Image:1.png]][[Image:0.png]][[Image:0.png]]")
- if s != "3" {
- t.Fail()
- }
-
- s = parseScore("{{Rating|3|5}}")
- if s != "3" {
- t.Fail()
- }
- s = parseScore("{{Rating|4.5|5}}")
- if s != "4.5" {
- t.Fail()
- }
- s = parseScore("**")
- if s != "2" {
- t.Fail()
- }
- s = parseScore("4½")
- if s != "4.5" {
- t.Fail()
- }
- s = parseScore("1.5")
- if s != "1.5" {
- t.Fail()
- }
- s = parseScore("2,5")
- if s != "2.5" {
- t.Fail()
- }
- }
|