Skip to content

Commit

Permalink
Removed redundant func
Browse files Browse the repository at this point in the history
  • Loading branch information
aneshas committed Jun 12, 2016
1 parent ebcd053 commit 0d1d1f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 0 additions & 8 deletions map.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@ package qparams
import (
"fmt"
"strings"
"unicode"
)

func upercaseInitial(str string) string {
for i, v := range str {
return string(unicode.ToUpper(v)) + str[i+1:]
}
return ""
}

func isOperator(c string, operators []string) (bool, int) {

for _, o := range operators {
Expand Down
8 changes: 7 additions & 1 deletion qparams_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func TestParseSliceCustomSeparator(t *testing.T) {

func TestParseMap(t *testing.T) {
type testStruct struct {
Filter Map `qparams:"ops:>,==,<=,<,!=,-like-"`
Filter Map `qparams:"ops:>,==,<=,<,!=,-like-,!"`
}

table := []testCase{
Expand Down Expand Up @@ -257,6 +257,12 @@ func TestParseMap(t *testing.T) {
ExpectedError: nil,
},

{
URL: "foobar.com?filter=,Age>8,Gender==1,Balance<100,foo!bar",
ExpectedResult: testStruct{Filter: Map{"age >": "8", "gender ==": "1", "balance <": "100", "foo !": "bar"}},
ExpectedError: nil,
},

{
URL: "foobar.com?filter=aGe!=9,Gender>0,Lastname-like-Doe",
ExpectedResult: testStruct{Filter: Map{"age !=": "9", "gender >": "0", "lastname -like-": "Doe"}},
Expand Down

0 comments on commit 0d1d1f9

Please sign in to comment.