-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix spliceList error for nested lists * Fix list indentation calculation * Add golden tests for spliceList * Remove skip flag on test added in 8cc8580 * Add missing line at end of file * Add spliceList tests * Skip random test that fails (20th iteration) * Add deeply nested input in golden tests for spliceList * Fix formatting to account for space in nested list * Add golden tests for weird spaces in nested list * Run dart format * Update `_formatNewBlock` to return indent size instead of the indent * Update test/testdata/input/splice_list_in_nested_block_with_weird_spaces.test --------- Co-authored-by: Jonas Finnemann Jensen <jopsen@gmail.com>
- Loading branch information
Showing
10 changed files
with
384 additions
and
12 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
13 changes: 13 additions & 0 deletions
13
test/testdata/input/splice_list_in_nested_block_with_weird_spaces.test
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,13 @@ | ||
SPLICE LIST IN A NESTED BLOCK LIST WITH WEIRD SPACES | ||
--- | ||
key: | ||
- - bar1 | ||
- bar2 | ||
- - foo | ||
- - baz | ||
--- | ||
- [splice, [key, 0], 0, 0, ['pre-bar1']] | ||
- [splice, [key, 0], 2, 0, ['post-bar2']] | ||
- [splice, [key, 2], 1, 0, ['post-baz']] | ||
- [splice, [key, 2], 0, 0, ['pre-baz']] | ||
- [splice, [key, 1], 0, 0, ['pre-foo']] |
13 changes: 13 additions & 0 deletions
13
test/testdata/input/splice_list_in_nested_block_without_initial_spaces.test
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,13 @@ | ||
SPLICE LIST IN A NESTED BLOCK LIST WITHOUT INITIAL SPACES | ||
--- | ||
key: | ||
- - bar1 | ||
- bar2 | ||
- - foo | ||
- - baz | ||
--- | ||
- [splice, [key, 0], 0, 0, ['pre-bar1']] | ||
- [splice, [key, 0], 2, 0, ['post-bar2']] | ||
- [splice, [key, 2], 1, 0, ['post-baz']] | ||
- [splice, [key, 2], 0, 0, ['pre-baz']] | ||
- [splice, [key, 1], 0, 0, ['pre-foo']] |
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,13 @@ | ||
SLICE LIST IN NESTED BLOCK LIST | ||
--- | ||
key: | ||
- foo: | ||
- - bar: | ||
- - - false | ||
- - - false | ||
- - - false | ||
--- | ||
- [splice, [key], 0, 0, ['pre-foo']] | ||
- [splice, [key, 1, 'foo', 0], 0, 1, ['test']] | ||
- [splice, [key, 2], 0, 0, ['test']] | ||
- [splice, [key], 4, 1, ['tail-foo']] |
50 changes: 50 additions & 0 deletions
50
test/testdata/output/splice_list_in_nested_block_with_weird_spaces.golden
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,50 @@ | ||
key: | ||
- - bar1 | ||
- bar2 | ||
- - foo | ||
- - baz | ||
--- | ||
key: | ||
- - pre-bar1 | ||
- bar1 | ||
- bar2 | ||
- - foo | ||
- - baz | ||
--- | ||
key: | ||
- - pre-bar1 | ||
- bar1 | ||
- post-bar2 | ||
- bar2 | ||
- - foo | ||
- - baz | ||
--- | ||
key: | ||
- - pre-bar1 | ||
- bar1 | ||
- post-bar2 | ||
- bar2 | ||
- - foo | ||
- - baz | ||
- post-baz | ||
--- | ||
key: | ||
- - pre-bar1 | ||
- bar1 | ||
- post-bar2 | ||
- bar2 | ||
- - foo | ||
- - pre-baz | ||
- baz | ||
- post-baz | ||
--- | ||
key: | ||
- - pre-bar1 | ||
- bar1 | ||
- post-bar2 | ||
- bar2 | ||
- - pre-foo | ||
- foo | ||
- - pre-baz | ||
- baz | ||
- post-baz |
Oops, something went wrong.