From bfe32e7efb19717c4054db9889239f48aebb6310 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Wed, 4 May 2022 01:12:03 -0400 Subject: [PATCH] Add AddArguments to TableEntry For usecase like below to reduce repeating arguments ``` for i, _ := range awsTests { var entry *TableEntry entry = &awsTests[i] entry.AddArguments(Label("aws")) } genericTests = append(genericTests, awsTests...) ``` --- table_dsl.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/table_dsl.go b/table_dsl.go index 0db0e71804..0038fb10de 100644 --- a/table_dsl.go +++ b/table_dsl.go @@ -114,6 +114,12 @@ func PEntry(description interface{}, args ...interface{}) TableEntry { return TableEntry{description: description, decorations: decorations, parameters: parameters, codeLocation: types.NewCodeLocation(1)} } +func (t *TableEntry) AddArguments(args ...interface{}) { + decorations, parameters := internal.PartitionDecorations(args...) + t.decorations = append(t.decorations, decorations) + t.parameters = append(t.parameters, parameters) +} + /* You can mark a particular entry as pending with XEntry. This is equivalent to XIt. */