# Test that duplicate imports--and, more generally, duplicate
# identical insertions--are coalesced.

checker -marker -fix -v example.com/a
stderr applied 2 fixes, updated 1 file
exit 0

-- go.mod --
module example.com
go 1.22

-- a/a.go --
package a

import (
	_ "errors"
	//@ fix1("()//", `"foo"`), fix2("()//", `"foo"`)
)

func f() {} //@ fix1("()}", "n++"), fix2("()}", "n++")

-- want/a/a.go --
package a

import (
	_ "errors"
	"foo" //@ fix1("()//", `"foo"`), fix2("()//", `"foo"`)
)

func f() { n++ } //@ fix1("()}", "n++"), fix2("()}", "n++")
