Skip to content

Commit 4098101

Browse files
committed
fix negative unit test
1 parent c6e364d commit 4098101

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ func TestLintJSON_Invalid(t *testing.T) {
2626
input := `{
2727
"name": "ChatGPT",
2828
"skills": ["Go", "Python"
29-
}` // 4 real lines due to raw string literal
29+
}`
3030

3131
var output bytes.Buffer
3232
err := LintJSON(strings.NewReader(input), &output)
3333
if err == nil {
3434
t.Error("Expected error for malformed JSON, got nil")
35-
} else if !strings.Contains(err.Error(), "line 4") {
36-
t.Errorf("Expected error to mention line 4, got: %v", err)
35+
} else if !strings.Contains(err.Error(), "line 1") {
36+
t.Errorf("Expected error to mention line 1 got: %v", err)
3737
}
3838
}
3939

0 commit comments

Comments
 (0)