diff --git a/bd.go b/bd.go index 892f03a..8875c2e 100644 --- a/bd.go +++ b/bd.go @@ -35,6 +35,10 @@ type Album struct { PrintDate time.Time } +func sanitizeTitleString(title string) string { + return "" +} + func (*Album) GetBedethequeComURI() string { return "" } diff --git a/bd_test.go b/bd_test.go index 600d4f2..3125964 100644 --- a/bd_test.go +++ b/bd_test.go @@ -12,6 +12,25 @@ type AlbumSuite struct{} var _ = Suite(&AlbumSuite{}) +func (s *AlbumSuite) TestSanitazation(c *C) { + data := map[string]string{ + "Le cycle de l'eau - I": "Le-cycle-de-l-eau-I", + "Nef des fous (La)": "Nef-des-fous", + "Oiseau noir (L')": "Oiseau-Noir", + "Foo": "Foo", + "Nuit de l'étoile (La)": "Nuit-de-l-etoile", + "Mon Père saigne l'Histoire": "Mon-Pere-saigne-l-Histoire", + "Les disparus d'apostrophes !": "Les-disparus-d-apostrophes", + "Eden - It's an Endless World!": "Eden-it-s-an-Endless-World", + "100.000 femmes (Les)": "100000-femmes", + } + + for title, expected := range data { + san := sanitizeTitleString(title) + c.Check(san, Equals, expected) + } +} + func (s *AlbumSuite) TestBedecomURI(c *C) { data := map[string]Album{ "BD-Okko-Tome-1-Le-cycle-de-l-eau-I-41693.html": Album{ @@ -78,6 +97,22 @@ func (s *AlbumSuite) TestBedecomURI(c *C) { Num: 4, NumA: "", }, + "BD-Eden-It-s-an-Endless-World-Tome-4-Vengeance-19912.html": Album{ + ID: 19912, + ISBN: "2845380429", + Series: "Eden - It's an Endless World!", + Title: "Vengeance", + Num: 4, + NumA: "", + }, + "BD-100000-femmes-Tome-1-100000-femmes-les-175515.html": Album{ + ID: 175515, + ISBN: "978-2-917456-30-9", + Series: "100.000 femmes (Les)", + Title: "100.000 femmes (les)", + Num: 1, + NumA: "", + }, } for expectedUrl, album := range data {