make gofumpt happy

Just a stricter gofmt; see mvdan.cc/gofumpt.
This commit is contained in:
Daniel Martí 2019-04-01 16:43:03 +01:00
parent 1decbccd74
commit d73caffcd0
3 changed files with 40 additions and 27 deletions

View File

@ -157,7 +157,6 @@ func TestMouseClickOffscreenNode(t *testing.T) {
if err := Run(ctx, MouseClickNode(nodes[0])); err != nil { if err := Run(ctx, MouseClickNode(nodes[0])); err != nil {
t.Fatalf("got error: %v", err) t.Fatalf("got error: %v", err)
} }
} }
var value int var value int

View File

@ -355,30 +355,38 @@ func TestAttributes(t *testing.T) {
by QueryOption by QueryOption
exp map[string]string exp map[string]string
}{ }{
{`//*[@id="icon-brankas"]`, BySearch, {
`//*[@id="icon-brankas"]`, BySearch,
map[string]string{ map[string]string{
"alt": "Brankas - Easy Money Management", "alt": "Brankas - Easy Money Management",
"id": "icon-brankas", "id": "icon-brankas",
"src": "images/brankas.png", "src": "images/brankas.png",
}}, },
{"body > img:first-child", ByQuery, },
{
"body > img:first-child", ByQuery,
map[string]string{ map[string]string{
"alt": "Brankas - Easy Money Management", "alt": "Brankas - Easy Money Management",
"id": "icon-brankas", "id": "icon-brankas",
"src": "images/brankas.png", "src": "images/brankas.png",
}}, },
{"body > img:nth-child(2)", ByQueryAll, },
{
"body > img:nth-child(2)", ByQueryAll,
map[string]string{ map[string]string{
"alt": `How people build software`, "alt": `How people build software`,
"id": "icon-github", "id": "icon-github",
"src": "images/github.png", "src": "images/github.png",
}}, },
{"#icon-github", ByID, },
{
"#icon-github", ByID,
map[string]string{ map[string]string{
"alt": "How people build software", "alt": "How people build software",
"id": "icon-github", "id": "icon-github",
"src": "images/github.png", "src": "images/github.png",
}}, },
},
} }
for i, test := range tests { for i, test := range tests {
@ -404,7 +412,8 @@ func TestAttributesAll(t *testing.T) {
by QueryOption by QueryOption
exp []map[string]string exp []map[string]string
}{ }{
{"img", ByQueryAll, {
"img", ByQueryAll,
[]map[string]string{ []map[string]string{
{ {
"alt": "Brankas - Easy Money Management", "alt": "Brankas - Easy Money Management",
@ -441,22 +450,28 @@ func TestSetAttributes(t *testing.T) {
attrs map[string]string attrs map[string]string
exp map[string]string exp map[string]string
}{ }{
{`//*[@id="icon-brankas"]`, BySearch, {
map[string]string{"data-url": "brankas"}, `//*[@id="icon-brankas"]`, BySearch,
map[string]string{
"alt": "Brankas - Easy Money Management",
"id": "icon-brankas",
"src": "images/brankas.png",
"data-url": "brankas"}},
{"body > img:first-child", ByQuery,
map[string]string{"data-url": "brankas"}, map[string]string{"data-url": "brankas"},
map[string]string{ map[string]string{
"alt": "Brankas - Easy Money Management", "alt": "Brankas - Easy Money Management",
"id": "icon-brankas", "id": "icon-brankas",
"src": "images/brankas.png", "src": "images/brankas.png",
"data-url": "brankas", "data-url": "brankas",
}}, },
{"body > img:nth-child(2)", ByQueryAll, },
{
"body > img:first-child", ByQuery,
map[string]string{"data-url": "brankas"},
map[string]string{
"alt": "Brankas - Easy Money Management",
"id": "icon-brankas",
"src": "images/brankas.png",
"data-url": "brankas",
},
},
{
"body > img:nth-child(2)", ByQueryAll,
map[string]string{"width": "100", "height": "200"}, map[string]string{"width": "100", "height": "200"},
map[string]string{ map[string]string{
"alt": `How people build software`, "alt": `How people build software`,
@ -464,8 +479,10 @@ func TestSetAttributes(t *testing.T) {
"src": "images/github.png", "src": "images/github.png",
"width": "100", "width": "100",
"height": "200", "height": "200",
}}, },
{"#icon-github", ByID, },
{
"#icon-github", ByID,
map[string]string{"width": "100", "height": "200"}, map[string]string{"width": "100", "height": "200"},
map[string]string{ map[string]string{
"alt": "How people build software", "alt": "How people build software",
@ -473,7 +490,8 @@ func TestSetAttributes(t *testing.T) {
"src": "images/github.png", "src": "images/github.png",
"width": "100", "width": "100",
"height": "200", "height": "200",
}}, },
},
} }
for i, test := range tests { for i, test := range tests {

View File

@ -28,7 +28,6 @@ func TestWaitReady(t *testing.T) {
if err := Run(ctx, Value(nodeIDs, &value, ByNodeID)); err != nil { if err := Run(ctx, Value(nodeIDs, &value, ByNodeID)); err != nil {
t.Fatalf("got error: %v", err) t.Fatalf("got error: %v", err)
} }
} }
func TestWaitVisible(t *testing.T) { func TestWaitVisible(t *testing.T) {
@ -53,7 +52,6 @@ func TestWaitVisible(t *testing.T) {
if err := Run(ctx, Value(nodeIDs, &value, ByNodeID)); err != nil { if err := Run(ctx, Value(nodeIDs, &value, ByNodeID)); err != nil {
t.Fatalf("got error: %v", err) t.Fatalf("got error: %v", err)
} }
} }
func TestWaitNotVisible(t *testing.T) { func TestWaitNotVisible(t *testing.T) {
@ -81,7 +79,6 @@ func TestWaitNotVisible(t *testing.T) {
if err := Run(ctx, Value(nodeIDs, &value, ByNodeID)); err != nil { if err := Run(ctx, Value(nodeIDs, &value, ByNodeID)); err != nil {
t.Fatalf("got error: %v", err) t.Fatalf("got error: %v", err)
} }
} }
func TestWaitEnabled(t *testing.T) { func TestWaitEnabled(t *testing.T) {
@ -180,7 +177,6 @@ func TestWaitNotPresent(t *testing.T) {
if err := Run(ctx, WaitNotPresent("#input3", ByID)); err != nil { if err := Run(ctx, WaitNotPresent("#input3", ByID)); err != nil {
t.Fatalf("got error: %v", err) t.Fatalf("got error: %v", err)
} }
} }
func TestAtLeast(t *testing.T) { func TestAtLeast(t *testing.T) {