Skip to content

Commit

Permalink
Merge pull request #8 from Rexios80/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpassos authored Oct 22, 2024
2 parents f4d4139 + 72900ef commit cd8346e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lib/src/node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class MapNode extends Node {
final indent = ' ' * context.indentSize;

if (node.requiresNewLine) {
lines.add("$key: ");
lines.add("$key:");
for (final line in nodeYaml) {
lines.add("$indent$line");
}
Expand Down
34 changes: 17 additions & 17 deletions test/yaml_writer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void main() {
print(yaml);

expect(yaml, equals(r'''
foo:
foo:
s1: Unquoted string with some@email and a /path/file.
s2: 'Quoted $string.'
s3: '@Quoted string.'
Expand All @@ -44,7 +44,7 @@ foo:
print(yaml2);

expect(yaml2, equals(r'''
foo:
foo:
s1: 'Unquoted string with some@email and a /path/file.'
s2: 'Quoted $string.'
s3: '@Quoted string.'
Expand All @@ -71,9 +71,9 @@ foo:
print(yaml);

expect(yaml, equals(r'''
foo:
foo:
s1: 'Some string'
bar:
bar:
s2: 'Another string'
'''));
});
Expand All @@ -92,7 +92,7 @@ foo:
print(yaml);

expect(yaml, equals(r'''
foo:
foo:
s1: 'Some string'
'''));
});
Expand Down Expand Up @@ -163,9 +163,9 @@ foo:

expect(yaml, equals(r'''
emptyList: []
objectWithEmptyList:
objectWithEmptyList:
emptyList: []
nestedList:
nestedList:
- []
- - 5
someValue: 5
Expand Down Expand Up @@ -239,33 +239,33 @@ l: {}
print(yaml);

expect(yaml, equals('''
a:
a:
- 1
- 2
- 3
b:
b:
- 10.2
- 30.4
c:
c:
ok: true
error: false
d:
d:
x: 1
y: 2
e:
e:
- id: 1
n: 10
- id: 2
n: 20
f:
f:
- |-
l1
l2
l3
- |
l10
l20
g:
g:
f1: |-
l1
l2
Expand All @@ -274,9 +274,9 @@ g:
l10
l20
h: {}
i:
i:
x: {}
y:
y:
- 1
- 2
- 3
Expand All @@ -298,7 +298,7 @@ i:

expect(yaml, equals(r'''
type: '_Foo'
obj:
obj:
id: 123
name: 'Joe'
'''));
Expand Down

0 comments on commit cd8346e

Please sign in to comment.