Skip to content

Commit 4b051fc

Browse files
committed
Avoid the version number in checkstyle tests
1 parent f904ff8 commit 4b051fc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/testthat/checkstyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<checkstyle version="lintr-3.0.1">
2+
<checkstyle version="lintr-x.y.z">
33
<file name="test_file">
44
<error line="1" column="2" severity="error" message="foo"/>
55
<error line="2" column="1" severity="info" message="bar"/>

tests/testthat/test-checkstyle_output.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ test_that("return lint report as checkstyle xml", {
2424
tmp <- tempfile()
2525
checkstyle_output(lints, tmp)
2626

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

0 commit comments

Comments
 (0)