# Test that signs are placed when opening a file that already has diagnostics. 

vim ex 'e main.go'
vimexprwait errors.golden GOVIMTest_getqflist()
vim ex 'e other.go'
vimexprwait placed.golden 'GOVIMTest_sign_getplaced(\"other.go\", {\"group\": \"*\"})'

# Assert that we have received no error (Type: 1) or warning (Type: 2) log messages
# Disabled pending resolution to https://github.com/golang/go/issues/34103
# errlogmatch -start -count=0 'LogMessage callback: &protocol\.LogMessageParams\{Type:(1|2), Message:".*' 

-- go.mod --
module mod.com

go 1.12
-- main.go --
package main

func main() {
    var z int
    z = z
}
-- other.go --
package main

import "fmt"

func foo() {
    fmt. Printf("%v")
}

-- errors.golden --
[
  {
    "bufname": "main.go",
    "col": 5,
    "lnum": 5,
    "module": "",
    "nr": 0,
    "pattern": "",
    "text": "self-assignment of z to z",
    "type": "",
    "valid": 1,
    "vcol": 0
  },
  {
    "bufname": "other.go",
    "col": 5,
    "lnum": 6,
    "module": "",
    "nr": 0,
    "pattern": "",
    "text": "Printf format %v reads arg #1, but call has 0 args",
    "type": "",
    "valid": 1,
    "vcol": 0
  }
]
-- placed.golden --
[
  {
    "bufname": "other.go",
    "signs": [
      {
        "group": "govim",
        "id": 1,
        "lnum": 6,
        "name": "GOVIMSignWarn",
        "priority": 12
      }
    ]
  }
]
