Fix area plural issue, add testcase

- Fix #168
This commit is contained in:
Joakim Fernstad 2017-06-22 21:38:41 +02:00 committed by Joakim Fernstad
parent c00ebe1911
commit 6022d471e3
2 changed files with 3 additions and 0 deletions

View file

@ -193,6 +193,7 @@ func newBoilRuleset() *inflect.Ruleset {
rs.AddSingularExact("is", "is", true) rs.AddSingularExact("is", "is", true)
rs.AddSingularExact("us", "us", true) rs.AddSingularExact("us", "us", true)
rs.AddSingularExact("as", "as", true) rs.AddSingularExact("as", "as", true)
rs.AddSingularExact("areas", "area", true)
rs.AddPluralExact("a", "a", true) rs.AddPluralExact("a", "a", true)
rs.AddPluralExact("i", "i", true) rs.AddPluralExact("i", "i", true)
rs.AddPluralExact("is", "is", true) rs.AddPluralExact("is", "is", true)

View file

@ -139,6 +139,7 @@ func TestSingular(t *testing.T) {
{"hello_people", "hello_person"}, {"hello_people", "hello_person"},
{"hello_person", "hello_person"}, {"hello_person", "hello_person"},
{"friends", "friend"}, {"friends", "friend"},
{"areas", "area"},
{"hello_there_people", "hello_there_person"}, {"hello_there_people", "hello_there_person"},
} }
@ -159,6 +160,7 @@ func TestPlural(t *testing.T) {
{"hello_person", "hello_people"}, {"hello_person", "hello_people"},
{"friend", "friends"}, {"friend", "friends"},
{"friends", "friends"}, {"friends", "friends"},
{"area", "areas"},
{"hello_there_person", "hello_there_people"}, {"hello_there_person", "hello_there_people"},
} }