Skip to content

Commit

Permalink
Avoid the version number in checkstyle tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jimhester committed Oct 11, 2022
1 parent f904ff8 commit 4b051fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle version="lintr-3.0.1">
<checkstyle version="lintr-x.y.z">
<file name="test_file">
<error line="1" column="2" severity="error" message="foo"/>
<error line="2" column="1" severity="info" message="bar"/>
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-checkstyle_output.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ test_that("return lint report as checkstyle xml", {
tmp <- tempfile()
checkstyle_output(lints, tmp)

expect_equal(readLines(tmp), readLines("checkstyle.xml"))
# The second line is the checkstyle version, so we ignore it during the
# check, so we don't have to update the version every release.
expect_equal(readLines(tmp)[-2], readLines("checkstyle.xml")[-2])
})

0 comments on commit 4b051fc

Please sign in to comment.