From d7c77895dcf0b415bb7018b0e5850603cf8879f7 Mon Sep 17 00:00:00 2001 From: "James G. Kim" Date: Fri, 5 Jun 2015 12:26:33 +0900 Subject: [PATCH] Add tests for only and except of post-processors --- template/parse_test.go | 34 +++++++++++++++++++++ template/test-fixtures/parse-pp-except.json | 8 +++++ template/test-fixtures/parse-pp-only.json | 8 +++++ 3 files changed, 50 insertions(+) create mode 100644 template/test-fixtures/parse-pp-except.json create mode 100644 template/test-fixtures/parse-pp-only.json diff --git a/template/parse_test.go b/template/parse_test.go index 46bb75ad8..9abca2f77 100644 --- a/template/parse_test.go +++ b/template/parse_test.go @@ -174,6 +174,40 @@ func TestParse(t *testing.T) { false, }, + { + "parse-pp-only.json", + &Template{ + PostProcessors: [][]*PostProcessor{ + []*PostProcessor{ + &PostProcessor{ + Type: "foo", + OnlyExcept: OnlyExcept{ + Only: []string{"bar"}, + }, + }, + }, + }, + }, + false, + }, + + { + "parse-pp-except.json", + &Template{ + PostProcessors: [][]*PostProcessor{ + []*PostProcessor{ + &PostProcessor{ + Type: "foo", + OnlyExcept: OnlyExcept{ + Except: []string{"bar"}, + }, + }, + }, + }, + }, + false, + }, + { "parse-pp-string.json", &Template{ diff --git a/template/test-fixtures/parse-pp-except.json b/template/test-fixtures/parse-pp-except.json new file mode 100644 index 000000000..dea70d3d3 --- /dev/null +++ b/template/test-fixtures/parse-pp-except.json @@ -0,0 +1,8 @@ +{ + "post-processors": [ + { + "type": "foo", + "except": ["bar"] + } + ] +} diff --git a/template/test-fixtures/parse-pp-only.json b/template/test-fixtures/parse-pp-only.json new file mode 100644 index 000000000..d2dbe07c6 --- /dev/null +++ b/template/test-fixtures/parse-pp-only.json @@ -0,0 +1,8 @@ +{ + "post-processors": [ + { + "type": "foo", + "only": ["bar"] + } + ] +}