From 6022d471e3c09341f56c4d4a4d467bfc7acff2e9 Mon Sep 17 00:00:00 2001 From: Joakim Fernstad Date: Thu, 22 Jun 2017 21:38:41 +0200 Subject: [PATCH] Fix area plural issue, add testcase - Fix #168 --- strmangle/inflect.go | 1 + strmangle/strmangle_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/strmangle/inflect.go b/strmangle/inflect.go index 6238c39..d81cb29 100644 --- a/strmangle/inflect.go +++ b/strmangle/inflect.go @@ -193,6 +193,7 @@ func newBoilRuleset() *inflect.Ruleset { rs.AddSingularExact("is", "is", true) rs.AddSingularExact("us", "us", true) rs.AddSingularExact("as", "as", true) + rs.AddSingularExact("areas", "area", true) rs.AddPluralExact("a", "a", true) rs.AddPluralExact("i", "i", true) rs.AddPluralExact("is", "is", true) diff --git a/strmangle/strmangle_test.go b/strmangle/strmangle_test.go index b07cee6..0d67cd5 100644 --- a/strmangle/strmangle_test.go +++ b/strmangle/strmangle_test.go @@ -139,6 +139,7 @@ func TestSingular(t *testing.T) { {"hello_people", "hello_person"}, {"hello_person", "hello_person"}, {"friends", "friend"}, + {"areas", "area"}, {"hello_there_people", "hello_there_person"}, } @@ -159,6 +160,7 @@ func TestPlural(t *testing.T) { {"hello_person", "hello_people"}, {"friend", "friends"}, {"friends", "friends"}, + {"area", "areas"}, {"hello_there_person", "hello_there_people"}, }