A few more tests to reduce risk of regressions (dart-lang/yaml_edit#77)
diff --git a/pkgs/yaml_edit/test/testdata/input/remove_block_list.test b/pkgs/yaml_edit/test/testdata/input/remove_block_list.test new file mode 100644 index 0000000..cf61522 --- /dev/null +++ b/pkgs/yaml_edit/test/testdata/input/remove_block_list.test
@@ -0,0 +1,14 @@ +REMOVE FROM LIST IN BLOCK MODE +--- + - true + - test: + - foo: true + bar: + - baz: + - nested: + foo: +--- + - [remove, [1, 'test']] + - [remove, [2, 'bar']] + - [remove, [3, 'baz']] + - [remove, [4, 'nested', 'foo']]
diff --git a/pkgs/yaml_edit/test/testdata/input/remove_flow_map.test b/pkgs/yaml_edit/test/testdata/input/remove_flow_map.test new file mode 100644 index 0000000..6bbf7ab --- /dev/null +++ b/pkgs/yaml_edit/test/testdata/input/remove_flow_map.test
@@ -0,0 +1,44 @@ +REMOVE FROM MAP IN FLOW MODE +--- +A: true +B: {foo: } +C: { + foo:,bar:true +} +D: { + foo: + ,bar:true +} +E: { + foo: # comment + ,bar:true +} +F: { + # comment + foo: + ,bar:true +} +G: { + # comment + foo: + # comment + ,bar:true +} +H: { + foo: # comment + , + bar:true +} +I: { + bar: true, foo: } +J: { foo : } +--- +- [remove, [B, foo]] +- [remove, [C, foo]] +- [remove, [D, foo]] +- [remove, [E, foo]] +- [remove, [F, foo]] +- [remove, [G, foo]] +- [remove, [H, foo]] +- [remove, [I, foo]] +- [remove, [J, foo]]
diff --git a/pkgs/yaml_edit/test/testdata/output/remove_block_list.golden b/pkgs/yaml_edit/test/testdata/output/remove_block_list.golden new file mode 100644 index 0000000..7aa3880 --- /dev/null +++ b/pkgs/yaml_edit/test/testdata/output/remove_block_list.golden
@@ -0,0 +1,36 @@ + - true + - test: + - foo: true + bar: + - baz: + - nested: + foo: +--- + - true + - {} + - foo: true + bar: + - baz: + - nested: + foo: +--- + - true + - {} + - foo: true + - baz: + - nested: + foo: +--- + - true + - {} + - foo: true + - {} + - nested: + foo: +--- + - true + - {} + - foo: true + - {} + - nested: + {}
diff --git a/pkgs/yaml_edit/test/testdata/output/remove_flow_map.golden b/pkgs/yaml_edit/test/testdata/output/remove_flow_map.golden new file mode 100644 index 0000000..690dcab --- /dev/null +++ b/pkgs/yaml_edit/test/testdata/output/remove_flow_map.golden
@@ -0,0 +1,258 @@ +A: true +B: {foo: } +C: { + foo:,bar:true +} +D: { + foo: + ,bar:true +} +E: { + foo: # comment + ,bar:true +} +F: { + # comment + foo: + ,bar:true +} +G: { + # comment + foo: + # comment + ,bar:true +} +H: { + foo: # comment + , + bar:true +} +I: { + bar: true, foo: } +J: { foo : } +--- +A: true +B: {} +C: { + foo:,bar:true +} +D: { + foo: + ,bar:true +} +E: { + foo: # comment + ,bar:true +} +F: { + # comment + foo: + ,bar:true +} +G: { + # comment + foo: + # comment + ,bar:true +} +H: { + foo: # comment + , + bar:true +} +I: { + bar: true, foo: } +J: { foo : } +--- +A: true +B: {} +C: {bar:true +} +D: { + foo: + ,bar:true +} +E: { + foo: # comment + ,bar:true +} +F: { + # comment + foo: + ,bar:true +} +G: { + # comment + foo: + # comment + ,bar:true +} +H: { + foo: # comment + , + bar:true +} +I: { + bar: true, foo: } +J: { foo : } +--- +A: true +B: {} +C: {bar:true +} +D: {bar:true +} +E: { + foo: # comment + ,bar:true +} +F: { + # comment + foo: + ,bar:true +} +G: { + # comment + foo: + # comment + ,bar:true +} +H: { + foo: # comment + , + bar:true +} +I: { + bar: true, foo: } +J: { foo : } +--- +A: true +B: {} +C: {bar:true +} +D: {bar:true +} +E: {bar:true +} +F: { + # comment + foo: + ,bar:true +} +G: { + # comment + foo: + # comment + ,bar:true +} +H: { + foo: # comment + , + bar:true +} +I: { + bar: true, foo: } +J: { foo : } +--- +A: true +B: {} +C: {bar:true +} +D: {bar:true +} +E: {bar:true +} +F: {bar:true +} +G: { + # comment + foo: + # comment + ,bar:true +} +H: { + foo: # comment + , + bar:true +} +I: { + bar: true, foo: } +J: { foo : } +--- +A: true +B: {} +C: {bar:true +} +D: {bar:true +} +E: {bar:true +} +F: {bar:true +} +G: {bar:true +} +H: { + foo: # comment + , + bar:true +} +I: { + bar: true, foo: } +J: { foo : } +--- +A: true +B: {} +C: {bar:true +} +D: {bar:true +} +E: {bar:true +} +F: {bar:true +} +G: {bar:true +} +H: { + bar:true +} +I: { + bar: true, foo: } +J: { foo : } +--- +A: true +B: {} +C: {bar:true +} +D: {bar:true +} +E: {bar:true +} +F: {bar:true +} +G: {bar:true +} +H: { + bar:true +} +I: { + bar: true} +J: { foo : } +--- +A: true +B: {} +C: {bar:true +} +D: {bar:true +} +E: {bar:true +} +F: {bar:true +} +G: {bar:true +} +H: { + bar:true +} +I: { + bar: true} +J: {}