diff --git a/CHANGELOG.md b/CHANGELOG.md index fe63cf3..fda811a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.1] - 2022-10-18 +### Fixed +- Fixed CONTAINS_ANY for string contains comparisons with slice/array. + ## [0.5.0] - 2022-10-13 ### Added - Added new `_lowercase_` COERCE identifier. @@ -48,8 +52,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial conversion from https://github.com/rust-playground/ksql. -[Unreleased]: https://github.com/go-playground/ksql/compare/v0.5.0...HEAD -[0.4.0]: https://github.com/go-playground/ksql/compare/v0.4.0...v0.5.0 +[Unreleased]: https://github.com/go-playground/ksql/compare/v0.5.1...HEAD +[0.5.1]: https://github.com/go-playground/ksql/compare/v0.5.0...v0.5.1 +[0.5.0]: https://github.com/go-playground/ksql/compare/v0.4.0...v0.5.0 [0.4.0]: https://github.com/go-playground/ksql/compare/v0.3.2...v0.4.0 [0.3.2]: https://github.com/go-playground/ksql/compare/v0.3.1...v0.3.2 [0.3.1]: https://github.com/go-playground/ksql/compare/v0.3.0...v0.3.1 diff --git a/README.md b/README.md index 39f71e0..94e7004 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ksql ===== -![Project status](https://img.shields.io/badge/version-0.5.0-green.svg) +![Project status](https://img.shields.io/badge/version-0.5.1-green.svg) [![GoDoc](https://godoc.org/github.com/go-playground/ksql?status.svg)](https://pkg.go.dev/github.com/go-playground/ksql) ![License](https://img.shields.io/dub/l/vibe-d.svg) diff --git a/parser.go b/parser.go index cfe9bf4..cc6008a 100644 --- a/parser.go +++ b/parser.go @@ -1101,7 +1101,7 @@ func (c containsAny) Calculate(src []byte) (any, error) { if !ok { continue } - if l == s { + if strings.Contains(l, s) { return true, nil } } diff --git a/parser_test.go b/parser_test.go index 35364b0..a2e4388 100644 --- a/parser_test.go +++ b/parser_test.go @@ -590,6 +590,12 @@ func TestParser(t *testing.T) { src: `{"f1":"dean","f2":"DeAN"}`, expected: true, }, + { + name: "CONTAINS_ANY contains, lowercase", + exp: `COERCE .Name _lowercase_ CONTAINS_ANY ["dodgers","yankees","tigers"]`, + src: `{"Name":"The New York Yankees"}`, + expected: true, + }, } for _, tc := range tests {