commit | 6906ac4c72a57bd5ac1638b9acde82995a1f4634 | [log] [tgz] |
---|---|---|
author | Devon Carew <devoncarew@google.com> | Tue Feb 20 12:52:00 2024 -0800 |
committer | GitHub <noreply@github.com> | Tue Feb 20 12:52:00 2024 -0800 |
tree | dcbd87d039db5e9b14b3686536a308eaa31e7d68 | |
parent | 2a9a11bee120d507d61d501c34585440be8c12b6 [diff] |
update the publish workflow (#67)
A library for YAML manipulation while preserving comments.
A simple usage example:
import 'package:yaml_edit/yaml_edit.dart'; void main() { final yamlEditor = YamlEditor('{YAML: YAML}'); yamlEditor.update(['YAML'], "YAML Ain't Markup Language"); print(yamlEditor); // Expected output: // {YAML: YAML Ain't Markup Language} }
void main() { final jsonString = r''' { "key": "value", "list": [ "first", "second", "last entry in the list" ], "map": { "multiline": "this is a fairly long string with\nline breaks..." } } '''; final jsonValue = json.decode(jsonString); // Convert jsonValue to YAML final yamlEditor = YamlEditor(''); yamlEditor.update([], jsonValue); print(yamlEditor.toString()); }
Testing is done in two strategies: Unit testing (/test/editor_test.dart
) and Golden testing (/test/golden_test.dart
). More information on Golden testing and the input/output format can be found at /test/testdata/README.md
.
These tests are automatically run with pub run test
.