From f432e2544f4912e4402d3082041d902b9415b61e Mon Sep 17 00:00:00 2001 From: Alexey Date: Sat, 2 Mar 2024 13:39:25 -0800 Subject: [PATCH] 0.7.1 (#89) --- CHANGELOG.md | 5 +++++ pubspec.yaml | 4 ++-- test/cases/cts | 2 +- test/helper.dart | 19 +++++++++++++------ 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0e8d99..39bad1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.7.1] - 2024-03-02 +### Changed +- Bumped the CTS to the latest + ## [0.7.0] - 2023-12-29 ### Changed - Renamed `Nodes` to `NodeList` @@ -181,6 +185,7 @@ Previously, no modification would be made and no errors/exceptions thrown. ### Added - Basic design draft +[0.7.1]: https://github.com/f3ath/jessie/compare/0.7.0...0.7.1 [0.7.0]: https://github.com/f3ath/jessie/compare/0.6.6...0.7.0 [0.6.6]: https://github.com/f3ath/jessie/compare/0.6.5...0.6.6 [0.6.5]: https://github.com/f3ath/jessie/compare/0.6.4...0.6.5 diff --git a/pubspec.yaml b/pubspec.yaml index 1d11891..ef66657 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: json_path -version: 0.7.0 -description: Implementation of JSONPath expressions like "$.store.book[2].price". Reads and writes values in parsed JSON objects. +version: 0.7.1 +description: "Implementation of RFC 9535 - JSONPath: Query Expressions for JSON. Reads and writes values in parsed JSON objects using queries like `$.store.book[2].price`." homepage: "https://github.com/f3ath/jessie" environment: diff --git a/test/cases/cts b/test/cases/cts index 446336c..c6261e1 160000 --- a/test/cases/cts +++ b/test/cases/cts @@ -1 +1 @@ -Subproject commit 446336cd6651586f416a3b546c70bdd0fa2022c0 +Subproject commit c6261e15635321c728b2b7ba4a822f73b2698b7a diff --git a/test/helper.dart b/test/helper.dart index 27cbc83..de91790 100644 --- a/test/helper.dart +++ b/test/helper.dart @@ -31,12 +31,18 @@ void runTestsInDirectory(String dirName, {JsonPathParser? parser}) { final List? paths = t['paths']; final List? pointers = t['pointers']; final String? skip = t['skip']; - final List? values = t['result']; + final List? result = t['result']; + final List? results = t['results']; final bool? invalid = t['invalid_selector']; group(name ?? selector, () { - if (values is List) { + if (result is List) { test('values', () { - expect(jsonPath(selector).readValues(document), equals(values)); + expect(jsonPath(selector).readValues(document), equals(result)); + }); + } + if (results is List) { + test('any of values', () { + expect(jsonPath(selector).readValues(document), anyOf(results)); }); } if (paths is List) { @@ -65,7 +71,7 @@ void runTestsInDirectory(String dirName, {JsonPathParser? parser}) { ); }); } - if ([values, paths, pointers, invalid].every((v) => v == null)) { + if ((result ?? results ?? paths ?? pointers ?? invalid) == null) { throw ArgumentError('No expectations found'); } }, skip: skip); @@ -76,11 +82,12 @@ void runTestsInDirectory(String dirName, {JsonPathParser? parser}) { const _knownKeys = { 'document', + 'invalid_selector', 'name', 'paths', 'pointers', + 'result', + 'results', 'selector', 'skip', - 'result', - 'invalid_selector', };