Skip to content

Commit

Permalink
Update tests to support go version changes (#1065)
Browse files Browse the repository at this point in the history
Using a different Go version changes where the affected line is in the
stdlib, so let's just set it to -1 to make it easier for local
development with newer go versions
  • Loading branch information
another-rex committed Jun 24, 2024
1 parent f40457e commit 8934cde
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
24 changes: 12 additions & 12 deletions internal/sourceanalysis/__snapshots__/integration_test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"position": {
"filename": "\u003cAny value\u003e",
"offset": -1,
"line": 97,
"line": -1,
"column": 26
}
},
Expand All @@ -124,7 +124,7 @@
"position": {
"filename": "\u003cAny value\u003e",
"offset": -1,
"line": 839,
"line": -1,
"column": 21
}
},
Expand All @@ -137,7 +137,7 @@
"position": {
"filename": "\u003cAny value\u003e",
"offset": -1,
"line": 1038,
"line": -1,
"column": 24
}
},
Expand All @@ -149,7 +149,7 @@
"position": {
"filename": "\u003cAny value\u003e",
"offset": -1,
"line": 430,
"line": -1,
"column": 21
}
},
Expand All @@ -161,7 +161,7 @@
"position": {
"filename": "\u003cAny value\u003e",
"offset": -1,
"line": 389,
"line": -1,
"column": 19
}
},
Expand All @@ -174,7 +174,7 @@
"position": {
"filename": "\u003cAny value\u003e",
"offset": -1,
"line": 1002,
"line": -1,
"column": 19
}
},
Expand All @@ -187,7 +187,7 @@
"position": {
"filename": "\u003cAny value\u003e",
"offset": -1,
"line": 1670,
"line": -1,
"column": 17
}
},
Expand All @@ -200,7 +200,7 @@
"position": {
"filename": "\u003cAny value\u003e",
"offset": -1,
"line": 2015,
"line": -1,
"column": 18
}
},
Expand All @@ -213,7 +213,7 @@
"position": {
"filename": "\u003cAny value\u003e",
"offset": -1,
"line": 3086,
"line": -1,
"column": 3
}
},
Expand All @@ -226,7 +226,7 @@
"position": {
"filename": "\u003cAny value\u003e",
"offset": -1,
"line": 2985,
"line": -1,
"column": 18
}
},
Expand All @@ -238,7 +238,7 @@
"position": {
"filename": "\u003cAny value\u003e",
"offset": -1,
"line": 3239,
"line": -1,
"column": 30
}
},
Expand All @@ -249,7 +249,7 @@
"position": {
"filename": "\u003cAny value\u003e",
"offset": -1,
"line": 19,
"line": -1,
"column": 28
}
}
Expand Down
1 change: 1 addition & 0 deletions internal/sourceanalysis/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func Test_runGovulncheck(t *testing.T) {
for _, traceItem := range res["GO-2023-2382"][2].Trace {
traceItem.Position.Filename = "<Any value>"
traceItem.Position.Offset = -1
traceItem.Position.Line = -1 // This number differs between go versions
}

testutility.NewSnapshot().MatchJSON(t, res)
Expand Down

0 comments on commit 8934cde

Please sign in to comment.