mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-05-20 10:54:28 -05:00
junit: Remove properties helper function in junit_test.go
This commit is contained in:
parent
2b3d79c572
commit
934b104ddd
@ -144,7 +144,9 @@ func TestMarshalUnmarshal(t *testing.T) {
|
|||||||
Skipped: 1,
|
Skipped: 1,
|
||||||
Time: "12.345",
|
Time: "12.345",
|
||||||
Timestamp: "2012-03-09T14:38:06+01:00",
|
Timestamp: "2012-03-09T14:38:06+01:00",
|
||||||
Properties: properties("key", "value"),
|
Properties: &[]Property{
|
||||||
|
{Name: "key", Value: "value"},
|
||||||
|
},
|
||||||
Testcases: []Testcase{
|
Testcases: []Testcase{
|
||||||
{
|
{
|
||||||
Name: "test1",
|
Name: "test1",
|
||||||
@ -179,14 +181,3 @@ func TestMarshalUnmarshal(t *testing.T) {
|
|||||||
t.Errorf("Unmarshal result incorrect, diff (-want +got):\n%s\n", diff)
|
t.Errorf("Unmarshal result incorrect, diff (-want +got):\n%s\n", diff)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func properties(keyvals ...string) *[]Property {
|
|
||||||
if len(keyvals)%2 != 0 {
|
|
||||||
panic("invalid keyvals specified")
|
|
||||||
}
|
|
||||||
var props []Property
|
|
||||||
for i := 0; i < len(keyvals); i += 2 {
|
|
||||||
props = append(props, Property{keyvals[i], keyvals[i+1]})
|
|
||||||
}
|
|
||||||
return &props
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user