From ca50d4b2b194446d6dd84055326b4217c710cb7b Mon Sep 17 00:00:00 2001 From: Jonas Finnemann Jensen Date: Mon, 6 May 2024 14:14:26 +0200 Subject: [PATCH] A few more tests to reduce risk of regressions --- test/testdata/input/remove_block_list.test | 14 + test/testdata/input/remove_flow_map.test | 44 +++ test/testdata/output/remove_block_list.golden | 36 +++ test/testdata/output/remove_flow_map.golden | 258 ++++++++++++++++++ 4 files changed, 352 insertions(+) create mode 100644 test/testdata/input/remove_block_list.test create mode 100644 test/testdata/input/remove_flow_map.test create mode 100644 test/testdata/output/remove_block_list.golden create mode 100644 test/testdata/output/remove_flow_map.golden diff --git a/test/testdata/input/remove_block_list.test b/test/testdata/input/remove_block_list.test new file mode 100644 index 0000000..cf61522 --- /dev/null +++ b/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/test/testdata/input/remove_flow_map.test b/test/testdata/input/remove_flow_map.test new file mode 100644 index 0000000..6bbf7ab --- /dev/null +++ b/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/test/testdata/output/remove_block_list.golden b/test/testdata/output/remove_block_list.golden new file mode 100644 index 0000000..7aa3880 --- /dev/null +++ b/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/test/testdata/output/remove_flow_map.golden b/test/testdata/output/remove_flow_map.golden new file mode 100644 index 0000000..690dcab --- /dev/null +++ b/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: {}