Skip to content

Commit

Permalink
0.7.1 (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
f3ath authored Mar 2, 2024
1 parent 6c0748f commit f432e25
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion test/cases/cts
19 changes: 13 additions & 6 deletions test/helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand All @@ -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',
};

0 comments on commit f432e25

Please sign in to comment.