File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,9 @@ func FilterTokenizer() *Tokenizer {
146146func unescapeTokenString (in string ) string {
147147 // The call to ReplaceAll() implements
148148 // SQUOTE-in-string = SQUOTE SQUOTE ; two consecutive single quotes represent one within a string literal
149+ if in == "''" {
150+ return in
151+ }
149152 return strings .ReplaceAll (in , "''" , "'" )
150153}
151154
Original file line number Diff line number Diff line change @@ -457,6 +457,24 @@ func TestFilterNotBooleanProperty(t *testing.T) {
457457
458458}
459459
460+ func TestFilterEmptyStringToken (t * testing.T ) {
461+ tokenizer := FilterTokenizer ()
462+ input := "City eq ''"
463+ expect := []* Token {
464+ {Value : "City" , Type : FilterTokenLiteral },
465+ {Value : "eq" , Type : FilterTokenLogical },
466+ {Value : "''" , Type : FilterTokenString },
467+ }
468+ output , err := tokenizer .Tokenize (input )
469+ if err != nil {
470+ t .Error (err )
471+ }
472+ result , err := CompareTokens (expect , output )
473+ if ! result {
474+ t .Error (err )
475+ }
476+ }
477+
460478// Note: according to ODATA ABNF notation, there must be a space between not and open parenthesis.
461479// http://docs.oasis-open.org/odata/odata/v4.01/csprd03/abnf/odata-abnf-construction-rules.txt
462480func TestFilterNotWithNoSpace (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments