forked from google/json_serializable.dart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'google/master' into google#780
- Loading branch information
Showing
55 changed files
with
337 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
name: checked_yaml | ||
version: 1.9.0-dev | ||
version: 2.0.1 | ||
|
||
description: >- | ||
Generate more helpful exceptions when decoding YAML documents using | ||
package:json_serializable and package:yaml. | ||
repository: https://github.com/google/json_serializable.dart | ||
repository: https://github.com/google/json_serializable.dart/tree/master/checked_yaml | ||
environment: | ||
sdk: '>=2.12.0-0 <3.0.0' | ||
sdk: '>=2.12.0 <3.0.0' | ||
|
||
dependencies: | ||
json_annotation: '>=2.2.0 <5.0.0' | ||
json_annotation: ^4.0.0 | ||
source_span: ^1.8.0 | ||
yaml: ^3.0.0 | ||
|
||
dev_dependencies: | ||
build_runner: ^1.0.0 | ||
build_verify: ^1.1.0 | ||
json_serializable: ^3.0.0 | ||
json_serializable: ^4.0.0 | ||
path: ^1.0.0 | ||
test: ^1.16.0 | ||
test_process: ^1.0.1 | ||
test_process: ^2.0.0 | ||
|
||
dependency_overrides: | ||
json_annotation: | ||
path: ../json_annotation | ||
json_serializable: | ||
path: ../json_serializable | ||
# Need to update dependencies on these packages | ||
build_config: ^0.4.4 | ||
pubspec_parse: ^0.1.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:checked_yaml/checked_yaml.dart'; | ||
import 'package:json_annotation/json_annotation.dart'; | ||
import 'package:test/test.dart'; | ||
import 'package:yaml/yaml.dart'; | ||
|
||
void main() { | ||
test('bob', () { | ||
expect( | ||
() => checkedYamlDecode( | ||
'{"innerMap": {}}', | ||
(m) { | ||
throw CheckedFromJsonException( | ||
m!['innerMap'] as YamlMap, | ||
null, | ||
'nothing', | ||
null, | ||
); | ||
}, | ||
), | ||
throwsA( | ||
isA<ParsedYamlException>() | ||
.having( | ||
(e) => e.message, | ||
'message', | ||
'There was an error parsing the map.', | ||
) | ||
.having((e) => e.yamlNode, 'yamlNode', isA<YamlMap>()) | ||
.having( | ||
(e) => e.innerError, | ||
'innerError', | ||
isA<CheckedFromJsonException>(), | ||
) | ||
.having((e) => e.formattedMessage, 'formattedMessage', ''' | ||
line 1, column 14: There was an error parsing the map. | ||
╷ | ||
1 │ {"innerMap": {}} | ||
│ ^^ | ||
╵'''), | ||
), | ||
); | ||
}); | ||
} |
Oops, something went wrong.