Skip to content

Conversation

@mekegi
Copy link
Contributor

@mekegi mekegi commented Jul 17, 2018

A lot of cases when func with one param func Sin(x int) int,
or writers func Write(w io.Writer, b []bytes)
and in generated tests for such func we see a lot of boilercode like
type args struct { x int }
In my pull request I try ti prevent creating unuseful args type for one param
Now generated tests looks like:

	tests := []struct {
		name string
		arg  string
	}{
	// TODO: Add test cases.
	}
	for _, tt := range tests {
		Foo3(tt.arg)
	}

instead of

	type args struct {
		s string
	}
	tests := []struct {
		name string
		args args
	}{
	// TODO: Add test cases.
	}
	for _, tt := range tests {
		Foo3(tt.args.s)
	}

mekegi and others added 2 commits July 17, 2018 19:07
```
	tests := []struct {
		name string
		arg  string
	}{
	// TODO: Add test cases.
	}
	for _, tt := range tests {
		Foo3(tt.arg)
	}
```
instead of
```
	type args struct {
		s string
	}
	tests := []struct {
		name string
		args args
	}{
	// TODO: Add test cases.
	}
	for _, tt := range tests {
		Foo3(tt.args.s)
	}
```
@coveralls
Copy link

coveralls commented Jul 17, 2018

Coverage Status

Coverage remained the same at 96.327% when pulling 45ff4bc on mekegi:master into a680bea on cweill:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants