Skip to content

Commit

Permalink
github-check: add source tests
Browse files Browse the repository at this point in the history
  • Loading branch information
haya14busa committed Jul 22, 2020
1 parent a5c995f commit ad84f03
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions _testdata/custom_rdjsonl.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
{"message":"range test 5 (within line)","location":{"path":"_testdata/custom.txt","range":{"start":{"line":12, "column": 5},"end":{"line":12, "column": 7}}}}
{"message":"severity test 1","location":{"path":"_testdata/custom.txt","range":{"start":{"line":3, "column": 5}}}, "severity": "INFO"}
{"message":"severity test 2","location":{"path":"_testdata/custom.txt","range":{"start":{"line":3, "column": 4}}}, "severity": 2}
{"source":{"name": "rdjsonl-source"}, "message":"source test","location":{"path":"_testdata/custom.txt","range":{"start":{"line":3}}}}
22 changes: 22 additions & 0 deletions doghouse/server/doghouse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,20 @@ func TestCheck_OK(t *testing.T) {
},
},
},
{
Diagnostic: &rdf.Diagnostic{
Message: "source test",
Source: &rdf.Source{
Name: "awesome-linter",
},
Location: &rdf.Location{
Path: "sample.new.txt",
Range: &rdf.Range{
Start: &rdf.Position{Line: 2},
},
},
},
},
{
Path: "sample.new.txt",
Line: 2,
Expand Down Expand Up @@ -224,6 +238,14 @@ func TestCheck_OK(t *testing.T) {
Message: github.String("test severity override"),
Title: github.String("[haya14busa-linter] sample.new.txt#L2"),
},
{
Path: github.String("sample.new.txt"),
StartLine: github.Int(2),
EndLine: github.Int(2),
AnnotationLevel: github.String("warning"),
Message: github.String("source test"),
Title: github.String("[awesome-linter] sample.new.txt#L2"),
},
{
Path: github.String("sample.new.txt"),
StartLine: github.Int(2),
Expand Down

0 comments on commit ad84f03

Please sign in to comment.